In this case saying its 'legal' misses all the processes, politics, lobbying, accounting firms drafting laws, ideology, tax havens, that are all in play to leave little 'loopholes' like this for selective enrichment.
Google and other corporate interests who benefit from these 'loopholes' saying 'this is legal' is understandable, but why should an individual say this?
How about employees allowed to sell their services to a third parties incorporated in low tax regions competing for their membership, which in turn then license it to employers, leading to reduced tax in their home countries? Why is this not a thing? If everyone did that the whole tax base would dissipate and destroy our current system, hence its now allowed, why is the exact same thing ok for corporations?