In conversation, the question came up whether any past presidents had fled or left the country following the end of their term - I'm guessing none of them have fled, but surely it's possible one or more in history decided "cool, I was in charge but now I'm out"?
No former U.S. President has ever "fled" the country, in the sense that they were running from something, but several former Presidents have chosen to travel or live outside the United States for some period of time after their presidency. Probably the two most famous examples are Ulysses S. Grant and Theodore Roosevelt (though others have certainly traveled as well).
Ulysses S. Grant went on a "world tour", traveling to countries throughout Europe, Asia, and Africa from May 1877 to December 1879. Grant visited a variety of countries, including England, France, Italy, Germany, Egypt, India, China, and Japan, among many others. Though technically a personal trip, Grant often traveled on U.S. warships and acted as a de facto ambassador for the United States.
Theodore Roosevelt left the United States just a few weeks after the end of his presidency in March 1909 to travel on a hunting trip to Africa. Roosevelt spent about a year in Africa, during which time he and his companions captured or killed thousands of animals and collected thousands of plant samples. Many of the specimens collected on this trip were donated to the Smithsonian's National Museum of Natural History and the American Museum of Natural History in New York City.
Though not a U.S. President, the one former "president" who did attempt to flee the country was Confederate President Jefferson Davis. When it became clear that Richmond would fall to Union forces near the end of the Civil War, Davis attempted to flee to Texas - and possibly to Mexico, Cuba, or Europe - to avoid capture and continue the fight for the Confederate cause. Davis only made it as far as Irwinville, Georgia before he was captured by Union troops. Davis was imprisoned for two years and indicted, but never tried, for treason. After his release from federal custody, he went to live with his family briefly in Montreal, Canada and traveled to England on business. In 1869, he settled in Tennessee before moving back to his home state of Mississippi in 1876. Davis ultimately died in New Orleans in 1889.