Has a President ever died outside of the U.S.?
One of the answers below mentions Teddy Roosevelt becoming seriously ill while on an expedition to the Amazon Rain Forest.
Warren Harding also came close to dying outside the U.
While returning from Alaska, he stopped make a visit to Vancouver, BC (Canada).
While there he visited a golf course but had to stop his game, exhausted, after six holes (although he later returned to finish the last two).
He died just a few days later (in San Francisco).
The answer is no, but one, Teddy Roosevelt, came close.
In 1913–14 he was part of an expedition to the Amazon Rain Forest and became very sick.
He almost didn’t get out alive.
He only lived 5 years longer mostly due to his weakened state after the ordeal.
You can read about it here:
The list I’m linking in this answer contains the location of death of all 38 dead presidents, and all of them have died either in a state, or in Washington, DC.