And if I do not have such a computer? Can I store the keys on the flash drive, which I will connect only offline?
If you are talking about a Live USB which you can boot from, then it is more safe. The main problem is probably with rootkit which is persistent to the BIOS but if you're using a Linux distribution (probably), then you are fine. Memory is wiped everytime the ram loses power.
If you are talking about the same scenario as above, then there's no difference with the advice achow gave.
All new motherboards use digital signatures for verification of BIOS images, making it impossible to flash a malicious BIOS. Therefore persistence through the BIOS is not possible unless it's from the manufacturer only. (search: Lenovo rootkit)
There is a brief window of time where your keys are held unencrypted in memory. If you have a sophisticated virus on your machine that can read your machine's memory, then it can extract the keys from memory and wait until your computer goes back online to send those keys to an attacker. Because of this risk, if you want to have your wallet not be connected to the internet, you should have it on a computer which never has and never will be connected to the internet.
And if I do not have such a computer? Can I store the keys on the flash drive, which I will connect only offline?
No. If the computer has ever been online it could theoretically be infected by that virus, and if you connect it to the internet later after disconnecting your flash drive it could send your extracted private keys. The computer doesn't necessarily have to be online for the virus to work once the computer has been infected.