This is not correct. The octane number of diesel is a lot higher than that of gasoline[sup]*[/sup]. The octane number shows how resistant is the fuel to compression.
A fuel with higher octane number essentialy burns at a slower rate (this is one of the reasons diesel engines operate at low RPMs). So when diesel is injected into the combustion chamber of a petrol engine with a measly 10:1 compression ratio, only a small part of the mixture ignites, making the engine run very badly. It is exactly the opposite of knocking and pinging, which are caused by the mixture detonating too quickly.
[sup]*[/sup]They use the ketane scale for diesel fuels. But the equivalent octane number of diesel would be higher than that of gasoline.
I’ve spent several summers working in gas stations, including one that had diesel on half the pumps. Anyway, the gasoline all came out one nozzle, regardless of octane rating, and the diesel was the green handle. I happened to look out at the pumps and saw a little old lady trying to jam the diesel nozzle into her Buick. I got on the intercom and it still took me five minutes to convince her that the reason it wasn’t going in because that was the diesel.
Another story from the same store. I had a customer come in driving a very old conversion van running on gas. He had been having some sort of engine trouble and a mechanic told him to put in a little bit of diesel. He managed to drive off the lot but I don’t know how the car ran. I still have no idea what the mechanic’s reasoning was. There could be one, I guess (the compression thing maybe), but I can’t really come up with one.