Yes, you can apply for a Hungarian work visa from outside your home country. This can be done at a consular mission or a Hungarian diplomatic office in your place of residence, or at the nearest consulate or Hungarian embassy in your home country. There are, however, exceptions when there is no Hungarian consulate in your home country, wherein you can submit the visa application from the country where you are temporarily residing.