This has been speculated-on (in here) for many years.
Back in the good old days, when you parked on a street, you did not get out on the street side (you could get hit by a vehicle in the road).
People simply got into the safe habit of :
- locking the driver's door from the inside
- sliding over to the right side
- getting out through the right-side door
- looking that door from the outside
Confirmation of this can be seen near the end of the excellent movie "Hud". The kid got in and got out of the right side of his old Chevy pickup truck (out of habit - in his driveway).