For those who don’t have driving experience in multiple countries, note that whether you are in a left hand drive or a right hand drive car the accelerator remains on the right.
It isn't the way things have always been. Look through the history of cars and you'll find a wide range of different setups with brakes being hand operated, a central accelerator and all sorts of different setups. But we have settled on the standard that we have today, and looking at it from a pure UX pov it does make sense.
Right-handedness is a big part of it certainly. Since a significant majority are right dominant it makes sense that the dominant pedal be the right most.
A nice thing about the ordering of the pedals is that they follow a neat and memorable ABC order- Accelerator, Brake, Clutch. It’s in an order which is both memorable, and more importantly, ergonomic.
1: Switching from the accelerator to the brake is something that it is expected you will often have to do in quite a hurry. The brake needs to be easily and quickly accessible and your foot is usually on the accelerator so it is a quick hop to the next pedal. It is logical that these two be near each other.
2: The clutch is designed to be used much of the time not as a stand alone pedal but in combination with the accelerator. You do not take your foot off the accelerator to use the clutch, instead you use your left foot on the clutch in combination with your right on the accelerator.
Having these two pedals next to each other wouldn’t be ergonomic; just imagine trying to delicately release the clutch and press the accelerator with your legs touching each other.
3: To stop the car you do need to use the side by side clutch and brake, which would seem to break the rule of side by side pedals being uncomfortable. However, this kind of controlled stop is a far less stressful situation than an emergency brake and a far less delicate manoeuvre than starting up the car.
When starting the car you gently bring the gear to biting point with the accelerator.
When stopping you merely have to push the clutch down to the bottom and then push the brake; either you will brake to a complete stop and switch the car into neutral, or you will change to a lower gear and then change from the brake to the accelerator once more (thus taking us back to point 2).
4: Note the missing combination in this "How to drive a car 101"- the brake and the accelerator.
Both of these pedals are operated by the right foot with the secondary, supporting and quite useless by itself (you may shift between gears with just the clutch but you will then soon after press the accelerator again), clutch pedal being used with the left in combination with one of these.
To come back to the emergency stop of point (1) it thus makes sense that the right most of this primary two be the accelerator, it being easier to quickly close your legs a little than to open them a little.