The lack of work permit, or other form of legality for entering and staying in a country is the very reason you have to be able to live and work in the country. Otherwise the company would be at cost to issue the permit, which is not really in their best interests to do so.