You can run gasoline in a diesel motor, but it causes problems. As mentioned elsewhere, when you compress the fuel/air mixture enough, it gets really hot then ignites. With diesel, this is ok, because the fuel burns (relatively) slowly, so it doesn't need to be timed very well.
Gasoline, on the other hand, burns really fast. If you consistently ignite the fuel a little too early, you'll blow holes in your pistons, break piston rings, break connecting rods, shatter crankshafts, blow head gaskets, etc. If you ignite it just a little too late, it won't ignite at all.
The timing is based on the heat inside the combustion chamber, which changes constantly. So it's much harder to get the perfect timing. Even if it doesn't damage anything (diesel engines are much sturdier than a similar gasoline engine), the early ignition means your flame front is working against the piston for the last few degrees and wastes a significant amount of energy. You could probably put knock sensors in the head and add extra fuel to keep the temperature down, but that would be much harder on the conventional carbureted engines that got the current design started.*
Similarly, you can run diesel in a gasoline motor, but it's not very efficient (if you can keep it running at all). The high compression of a diesel motor helps the diesel fuel burn better (diesel is hard to burn), and the high compression of the injection pumps helps vaporize the fuel (if you pour it down the intake it tends to stay in liquid form which doesn't burn well). Without those things, you're only going to extract a fraction of the available power from the fuel.
.* Note that this is a large part of the answer: Just because we can do something now with modern technology doesn't mean they could a hundred years ago. Now that we have a hundred odd years doing it one way, there's no reason to make radical changes now without a significant advantage to using the new method.