To work for a foreign employer, you'll need a work visa (very few exceptions to this), and to get a work visa, you will need a job offer to be submitted with your visa papers or in some other countries the employer will set this up for you in the host country. So the employer will have to provide the visa, either directly (by applying for you in the foreign country) or indirectly (by sending you a job off or invitation letter), this depends on the rules of the country. Of course this in case the employer is seeking foreign employees, if you are finding a job abroad while the company is seeking local hires, then expect nothing, unless they really need you.
An exception to above would be when you are already in the foreign country, working for another employer, then this depends from one country to another, but usually it is simple in this case, you will only have to change the employer information at some government office.