It's often very difficult to put diesel fuel in a regular gasoline car by mistake, the nozzle of the fuel dispenser is typically way too big. I assume there might be some international standard behind this, at least I noticed it in several countries (but I also came across some exceptions).
Making a mistake the other way around is actually not that difficult, I have seen it happen. Diesel rental cars therefore usually have prominent signs in several places, including on the little door or cap of the fuel tank itself. I also noticed this on diesel rentals in several European countries.