Upvote:3
De jure there are dozens of complex laws and regulations regarding remote employment, under which you may or may not need a special visa in order to work in a given country. Tax laws are an additional complication, where countries such as the UK can deem you as a tax resident for spending as little as 16 days on British soil. And as you said it yourself - things might be even more complicated if your employer is fully (or partially) based in the country of your travel.
De facto, as long as you don't mention your remote job to immigration personnel at the airport, there's a 99.99% chance no one will ever find out. There are millions of people breaking the law by being employed at on-site jobs in any given country, so digital nomads are a pretty low priority for law enforcement.