This has been studied and it doesn't actually change the big picture much.
https://www.carbonbrief.org/mapped-worlds-largest-co2-import...
US up 6%, China down 10% for example.
But, yes, to accurately track responsibility this adjustment should be made or else unethical people will have an incentive to shift production to lax regimes.
One mildly surprising aspect is that countries that export fossil fuels show up here, even if you count the burning on the importer side. This is because the drilling and mining has carbon impacts on top of the burning.