Yes, but 'work' also has a legal definition. My research mostly involves Canada, so I will cite from the IIRC [1]:
"What kind of activities are not considered to be “work”?
An activity which does not really 'take away' from opportunities for Canadians or permanent residents to gain employment or experience in the workplace is not “work” for the purposes of the definition.
...- long distance (by telephone or Internet) work done by a temporary resident whose employer is outside Canada and who is remunerated from outside Canada;
...
We recognize that there may be overlap in activities that we do not consider to be work and those activities which are defined as work not requiring a work permit in R186. However, the net effect (no work permit required) is the same."
So yes, you can work remotely from Canada, while on a tourist visa, for a foreign (non-Canadian) employer.
A lot of OECD countries have treaties (look up 'double-taxation treaty between A and B'), that govern this.
1 - https://www.canada.ca/en/immigration-refugees-citizenship/co...