There is no API to determine:
Which store the app was bought from
Which store the device is currently configured to use
One option here is to ‘duplicate’ your app, remove the objected-to content from the copy, make that available in the objecting countries, and withdraw the original from those countries.
Another option is to use the phone’s physical location to decide what to display.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
You find it simpler to just take that app off-sale (via rights/pricing in ASC) in whichever countries you wish to restrict sales.
And yes, locale is a poor choice as it doesn't allow you the opportunity to bifurcate between a user's geographical postion vs. their home store. They can only download from their home store in any case.