Where is it legal to be a digital nomad?

In which countries is it legal, to any extent, to work on a tourist visa?