I did state that people working without a work permit in a foreign country may violate the terms of their visa, or other laws, by doing so. As a practical matter each person has to weigh the risks and consequences.

An employer that knowingly lets employees work remotely in foreign countries may very well create a tax and legal liability by doing so. But a contractor -- technically a self-employed person -- has an arms-length relationship with their customers. Specifically if I contract with a US company that company has no liability regarding my taxes or my compliance with immigration or other laws. As a contractor if I decide to live in Mexico or Thailand for a while and work from there, my customers don't bear responsibility for my decision. They can terminate the contract if they don't want to take chances (or, more likely, deal with timezone differences).

Most of the countries that attract digital nomads also attract a lot of tourists, so those governments take a careful approach not to affect tourism -- a much larger source of revenue than taxing a handful of DNs. How would immigration officials distinguish a person on holiday who checks work emails now and then, or takes a work phone call, from an nomad entrepreneur running a business from co-working spaces? They can't, at least not reliably, so they mostly choose to look the other way and allow DNs to hide among the tourists. DNs who advertise or brag about what they do, or have active social media presence promoting their DN lifestyle, may get in trouble, but even that seems rare. In Thailand a few years back police raided a popular co-working space in Chiang Mai -- ground zero for DNs back then -- but then got told to back off by the government, probably under pressure from the powerful Tourism Authority. The meager possible tax revenues don't balance out the bad press that might deter tourists and their money.

So while we agree that technically DNs without specific permission to work (a DN visa or work permit) have probably broken the law, the laws have become anachronisms in the connected internet age. DNs recognize that, so do the governments.

The digital nomad visas (which vary wildly in their conditions from country to country) attempt to legitimize remote work and often (not always) collect taxes from the nomad. Ironically long-stay DN visas go against the original conception of what "digital nomad" means -- someone working remotely while traveling on tourist visas, staying longer than typical tourists but not as long as long-term or permanent expats. The people I personally know who have DN visas actually intend to stay long-term and build a business in a foreign country, but they don't qualify for (or can't afford) startup or investment visas, retirement visas, marriage visas, etc. that would permit a longer stay. They have drifted away from the "digital nomad" community, if that ever meant anything.

This topic comes up constantly in DN forums on Reddit and NomadList. The comments vary from self-righteous to bad advice to ignore and break laws. I would advise anyone who wants to work from a foreign (to them) country to look into the immigration and maybe labor laws, and the tax implications, and then decide what they think applies to them, then weigh the risks and possible consequences. Even so, good luck trying to figure out what "work" means in Thai or Mexican law (or US law, for that matter).

I have not heard of DNs anywhere getting arrested, fined, or deported for working in coffee shops, and the authorities certainly know that goes on. I have heard of a few people deported for illegally running a local business and advertising it, or hiring locals.