The 1918 Flu was commonly called the Spanish Flu because all the other countries that got it were at war and so they censored reporting on the pandemic. Spain was neutral, and so it was the only country openly talking about the disease, and so everyone assumed it started there.
If the US in 1918 had implemented a travel ban against Spain to try to stop the disease from 'arriving,' it would have done nothing, since the epidemic had one of its earliest (perhaps FIRST) outbreaks in a military base in Kansas.
There wasn't a travel ban back then, but if the US had wanted a travel ban, it could have banned folks from its own country leaving and spreading the flu. Or, more justly, it could have implemented restrictions on all foreign travel, recognizing that by the time you detect a pattern of an epidemic, it's probably already spreading all over the place, and it's naive to pretend otherwise.
Today, we could fund ubiquitous testing at both ends of international journeys, maybe with an added one day isolation for visitors from places with known community spread of a variant of concern.