The issue is neither corporate tax nor globalization, but the difference between corporate tax rates, which provides an incentive in the first place to shuffle profits offshore.
A solution could be to tax offshore expenses with the difference in tax rates, i.e., min(0, corporate tax rate -destination company's corporate tax rate)%. That would eliminate the advantage of lower tax rates at the destination.
Another way would be to allow deducting only min(100, 100 - corporate tax rate + destination company's corporate tax rate)% of the offshore expenses. That still provides benefits for shuffling profits offshore, but the origin location gets some of it.