Air Force One is a military plane. Unlike a civilian airliner, it can't just fly over whatever country is convenient to get from point A to point B. Like any USAF plane, it needs clearance from any country it overflies. So, landing in 'unfriendly' countries is pretty unlikely, because it is not going to be in the middle of Iranian airspace when an IFE occurs, because 1) we aren't going to want to fly over Iran and 2) they would deny clearance anyway.
The mission planners would be sure that there were sufficient divert airfields along the path to handle a 747. They would also make sure that those fields could provide logistical and security support. Even when AF1 has a planned landing at a foreign field, the US is only providing close in security of the plane and the POTUS; the locals are providing most of the security.
The Secret Service and USAF security forces have a presence on the plane. That's all you need to know.