If you don't have an embassy where you live, you can spend a little money and have a travel agent do it for you, and you'll save yourself a lot of trouble.
Also, do a little homework beforehand to find out if the country you want to go to has a visa-on-arrival, if so you can get off the plane and apply for a visa on-site, there are also some countries where you can apply for a visa online.
It is important to note that the visa on arrival may be different from the regular visa, for example, to Thailand, the regular visa can be 30 days, while the visa on arrival is only 15 days.