How can I invest money in stocks via USA broker, while being a citizen of Ukraine? I don't want to go through brokers in my country, because we don't have a good legal system and a lot of corruption, so I think it is not very safe option.
The US has a tax treaty with Ukraine (unlike Singapore), so you should be in a similar situation to Canadians etc. who choose to use a foreign broker.
You'll have to file a W8BEN to reduce withholding taxes, and they'll want identification documentation and so on, and I imagine they'll want a wire transfer to fund the account.
In many places now they are requiring permission to share information with the tax authorities in your home country (you waive your privacy), but that may not be true with Ukraine, and should not be a problem in any case if you're being upfront.
I personally am from Canada and use my local bank to trade stocks. Contact your local bank and they will tell you how to do it, since rules depend on country of residency. If you are not close to a bank, e-mail the major bank in the country of your residence.
If you have trouble with the USA then you might also consider an account in Singapore. They're also better about international situations than the USA. They also have a reputation for "slapping down" on corruption.