That's not true, and it's often not well known, but your own physical location is also a factor, not only your source of income. Most countries would never detect this anyways, but you shouldn't think that it's legal at all.
Please let me know if I was given bad legal advice, because I don't want to get thrown in jail in the future.