The engines are designed quite specifically for the type of fuel that will be burned in them. Although technically you could make a diesel engine that would burn normal petrol, it would not be advisable to put normal petrol in a diesel car, because the engine relies on the fact that diesel is a better lubricant than petrol. Also, various components (such as fuel filters, fuel pumps, etc) also depend on the fuel being of a certain type, and would be damaged or otherwise fail to work with the wrong fuel.
The bigger problem (other than lubrication) is managing the moment of detonation. Petrol would explode way too early in the cycle of injection, that's why it will damage a diesel engine.
In a diesel engine, only fresh air is in the cylinder during the compression cycle. At the top of the compression cycle, that's when the fuel starts to be injected and immediately burns/explodes. There's other reasons why petrol in a modern diesel engine wouldn't work, but i don't think pre-ignition/detonation is one of them.
"Throttle" in a diesel actually controls for how long the injection takes place.
But the fuel injected does not detonate immediately, it is allowed to spread out a bit and the chambers are shaped to channel the detonation. It's a short interval but it is an interval. Injecting gasoline at those pressures and temperatures would mean instantaneous detonation of the fuel injected, too early in the cycle which will cause damage (to the injector, and to the crankshaft and/or pushrod bearings because they'll have to deal with more force than what they were designed to cope with because the energy is liberated in a much shorter time-frame). At best this will cause severe degradation of engine life, at worst immediate failure.
Another issue is that the injectors are carefully shaped to deliver a mist of fuel and the properties of gasoline and diesel are sufficiently different that the droplets will be of the wrong size and won't separate cleanly from the injector before detonation occurs.
All in all, not something you want to experiment with so if you find that you've 'gassed up' your diesel vehicle better drain the tank instead of taking your chances.
In winter in Canada it is common to put about 5% gasoline in the diesel fuel to overcome temperature effects on the diesel fuel.