It’s called “transfer pricing” and it’s been going on for decades: https://en.wikipedia.org/wiki/Transfer_pricing
Short of a revenue (as opposed to income) corporate tax or VAT, it’s a very tricky problem to address. Maybe an excise tax on foreign remittances to match the highest corporate bracket.
Or you just scrap corporate tax entirely because it’s a terrible idea anyway.