Actually most cars have it on the right (at least out of the ones I’ve driven). I’ve only seen a few that don’t. I suppose it has to do with which side of the pump you want to stop when you’re at the gas station.
My assumption (and I have no proof of that) is that the first gas stations would only have one lane through which the cars would pass. And probably only one pump, with one type of petrol. So cars that drive on the right (as in the US) would drive in and have the pump on the right (with the shop on the other side of the pump). Or even have grass on the other side of the pump. Which of course does not apply nowadays, with several pumps operating simultaneously on several lanes in most gas stations.