What countries have explicit visas to accommodate remote workers (e.g. https://www.wherecani.live/blog/view/digital-nomads--the-sel...)
What countries are popular with digital nomads because they're cheap, tropical, and no one is probably going to ask too many questions if you hang out on your tourist visa for a good stretch.
To work legally in Thailand you need a work permit which you can only get on an eligible visa. A tourist visa or visa exempt stamp, which digital nomads enter on, is ineligible. And it requires an employer to sponsor it. Even volunteering requires a work permit.
As long as you keep it quiet and don't make enemies you can fly under the radar. But if someone rats you out or the police see an opportunity to make some easy money you will have a very bad time.
On the other hand if your employer has a business presence in-country that can be quite problematic for the employer because it may cause them to run afoul of local visa regulations for employees. US companies also can run into tax problems if they make payments to people resident in other countries as this may look to the IRS like aiding tax evasion. (IANAL but have some experience with this issue from the employer perspective.)