When you use petrol in a diesel engine it simply cleans out the fuel system, but then refuses to run unti l you get the fuel and loosened crud out. Hopefully a fuel filter will catch all the crud that gets loosened. Since the anti-knock index of gasoline is higher than diesel, it will not burn well in a diesel, but shouldn't kill it.
The opposite situation is worse. Diesel ignites much easier than gasoline in the presence of heat and pressure, (but oddly enough is very stable without heat and pressure) So when your gasoline engine tries to put it in the cylinder and compress it, it will detonate before the spark plug lights it off, which is called knock, and that causes excessive heat in the cylinders, which can literally melt parts of yoru engine.
Nozzles at a filling station gasoline pump are smaller than diesel ones, so it is not possible to accidentally put diesel in a gas car unless you really try hard, but it is possible to put gasoline in a diesel tank. I used to own an old mercedes diesel, and I'd put 15% 87 octane gasoline in it whenever I filled up in the winter to try to keep the fuel less viscous to make it easier to start in lower temperatures. I think up to 15% is acceptable. Some push it higher, but I wouldn't.
A few notes from other answers:
Diesels do not run on glow plugs. They only use them to heat up the cylinders prior to starting the engine, but once it is started aren't used again. This is because diesels need heat and pressure to cause combustion. With a cold cylinder it won't work.
Diesel is not rated with octane at all, but if it were, it would be lower-not higher than gasoline, which means it is easier to ignite in the presence of heat and pressure.
You will not blow the top of a diesel engine off by putting gas in it. You might blow the top of a gas engine off by putting diesel in it, but I doubt even that would happen.