Company A could simply incorporate a subsidiary in another country, then said subsidiary could hire workers to work for company A's whilst residing in company A's country. No work permit required.
What you've seen in response to this type of thing, at least in Thailand, is that it's harder to stay in the country for a long period of time even legitimately.
Visa lengths across land borders are being cut. Back-to-back visas are now limited. X months in X months out rules are being adopted. It's getting very difficult to stay in the country for longer than 6 months.
It's actually not impossible to get a work permit in Thailand but it is expensive (cheaper if you are an American or married to a Thai citizen). Most people just take the risk.