That's just tax fraud though.
There's also the CFC rule, which means that within the EU, if you control a foreign corporation, your country of tax residence can tax undistributed profits.
Often tax offices don't bother and you might not get caught, but 'not getting caught' is not the same as it being legit.