An engine designed for one fuel will not burn the other fuel.
The diesel fuel system uses the lubricity of the fuel to lubricate the pumps and injectors. Using a fuel with lower lubricity (e.g. petrol) will cause severe damage. It has been claimed that just starting a modern diesel engine with petrol in the tank can cause severe damage, and that if you accidentally put petrol in a diesel car you should push the car away from the pump and call out your rescue service. but not attempt to start the engine. That way you can get the car towed away, and the tank drained, cleaned and re-filled for only a few hundred pounds.