In a lot of airplanes (especially the older ones) the pilot sat in the middle.
When airframes got bigger, they also got bigger (or more) engines. In the propeller era this also produced a tendency to turn to one side easier than the other, so the drivers found turning that way to be easier (or no choice if you had a problem). If you are sitting in the middle it doesn't matter, if you have to choose a side you want the turn-toward side so you can see the ground.
A big design factor is most of us are right-hand dominant. If you have a 2-seat flight deck in side-by-side arrangement you probably want one set of common controls ( power, prop, mixture, radios etc. ) and the pilot would want to operate them with their dominant hand. You don't need precision control of the stick at the same time you are adjusting the engine or tuning the radio.
Also consider that the USA was a major player in aircraft design, and they drive on the right side of the road (same reason, going back to wagons in the frontier days). Back then the pilot was king, the copilot was a trainee, management buys what the pilot tells them to buy, and the pilot will sit on the left because that's the same place he sits in his car.
Once that pattern started we end up being stuck with it. If the pilot sits on the left, they will park with the airport gate on the left and thus the doors are on the left. The next plane on the design board better follow the same conventions, because planes don't have reverse and airports didn't have tugs back then. Next we build jetways to hook up to the left side door, and now passenger cabin design expects the front left door to be the primary entrance - the front right door might not get opened for months.
Helicopters seat the pilot on the right for exactly the same reason - the pilot is probably right-handed. In a helicopter, the cyclic needs constant, precise input. You typically can't let go of it, ever1. But the collective doesn't require constant attention, and in a 2-seater can be a shared control (mechanically simpler and lighter). The pilot accepts more difficult use of the radios etc. so he can keep it flying right side up.
1: In Terminator 2, the T-1000 grows an extra hand in order to fly a helicopter while reloading his weapons. Someone on the effects team did their homework.