depends, if there is no income tax in your country of residence, you are exempt. take digital nomads as an example, they invoice their off shore company and since they are not staying longer than 183 days in a country, they are basically pay 0% tax. thats all 100% legally fine.
Discussion
Yes, but digital nomads are non-residents and pay no income tax on their residence country (because they don't have one) - that is, if you aren't a citizen of one of the few countries that has global income tax.
That's not what we are talking about, nor what the Panama papers were about. They were about people that had a network of shell companies and foundations to divest funds off-shore, which is illegal pretty much everywhere, because is tax evassion, and potentially money laundry.