Were I so inclined, and I have been several times, I could put my car on a ferry and take it to France. There I have to drive on the other side of the road, a consequence of the French revolution, but otherwise matters are straightforward. My car fits on the road, I can buy fuel there and road signs are similar.
If you want to take your rail vehicle abroad, things are not so simple. Oh no.
Just for a start, it mightn’t fit. Most of the world uses the standard rail gauge of 1.435 m or 4' 8.5", a figure chosen on a fairly random basis by railway makers in the north of England and later marginally widened (by half an inch or about 10mm) to allow wagons with a 4'8" track to fit better. Most of the world, though, does not equal all of the world. Ireland, for example, has a gauge of 1.60 m. Which is fine, because it’s an island. Spain uses the Iberian gauge of 1.668 m and that’s not fine because it’s not an island. If you want to travel between France and Spain by rail you have a difficulty. If carrying self-loading cargo you can get them to decamp to a different train on the other side of the border but it’s not easy to do this with conventional cargo. The original technique was to change all the axles, a painfully slow and expensive process. A refinement is to do bogie exchange where you haul up each carriage, remove the bogies and swap in other ones, a process which is still slow and requires a workforce and a stock of spare bogies. After all that you still have to swap the locomotive because it takes too long to do a bogie swap when the wheels are powered.
Fortunately, there’s a better way. You do it using a compatible train with variable gauge axles and a gauge changer, a thing which was rather a game changer. You tow or push your train in at a little over walking speed, each carriage is lifted a little on side rails and then the wheels are unlocked, moved in or out on their axles and relocked.
You’ll find a couple of these on the Spanish border. The Spanish decided to build their high speed lines on standard gauge to avoid this problem, but this creates a need for gauge changers in Spain as well to allow interoperability.
Easy peasy, but you still have to swap locomotives in most cases.
Now you’ve arrived abroad. Have your problems been sorted? No, of course not. You may need a supply of electrons. Most countries in Europe and much of the rest of the world use the same domestic supply of 230(ish) V and 50 hz. No good for you though because railways use different voltages in the same country, never mind in different ones. You’ll be needing a locomotive which can cope with two or more voltages and possibly DC and AC. Just to add to that, you may encounter overhead lines or third rails.
Having dealt with all that, are we done? No, of course not. Trains can go very fast. They’re not good at going slower because steel wheels with tiny contact areas and they can’t avoid obstacles so they depend on signalling. Like the power supply, this varies and so you have to fit signalling equipment to comply with the rules in every place you’re going to travel and then take a sample locomotive there and have it certified.
Now can you proceed? Certainly, if your carriages are the right height for platforms abroad and the spacing between carriage and platform is OK and if the spacing between each pair of rails isn’t too narrow for your rolling stock to be able to safely pass each other, you should be good to go.