Depends on the country. The UK's particularly bad (in my experience and from what I've heard from the digital nomad community) in that they don't like you working remotely at all while visiting, especially if you're staying for any significant amount of time (I'm here for 3 months).
The general rule is "if you make money while in a country, you need a work visa while in that country", but obviously that may be a bit outdated and not take into account remote positions. Many countries can/will fine, blacklist, and deport you if they find out you worked while within the country without a work visa; and it's _those_ people that you need to be able to convince "I'm not taking your jobs away!" to.
I'm a US citizen so I haven't looked into it from your POV, but I do know that a trip to Canada, for example, allows working remotely as long as:
* you work for an American company with no Canadian offices or branches[1],
* you are paid in American dollars, and
* that payment is deposited into an American bank account.
Again, depends on the country you're visiting (and possibly the country you're a resident of), so I'd double check before working on a trip just to be safe.
[1] If your company has branches where you're going, the safest bet is to get them to help arrange the trip. A have a family member that travels a lot on business and has been denied entry to countries while on business trips specifically to train the local branch, because even then it's a delicate situation.