Higher octane fuel does not burn as easily as a lower octane fuel. Higher octane fuels are specified where higher compression ratios are present in an engine, or where forced induction (such as turbo charging) is used. By using higher octane fuel where lower is specified, you will create no problems with your engine. It does not (by popular belief) add any power to your engine, but will not harm it at all. Worst case scenario is you've just wasted some money by buying the more expensive fuel.
If you put the lower octane fuel in an engine which specifies high octane fuel, will not cause you any major issues on an electronic fuel injected engine because it has a device known as a "knock sensor" which will pull timing. When a spark is fired at the spark plug, this event actually happens before the piston reaches top dead center (TDC - upper most position in the cylinder). This allows for the air/fuel explosion time to reach it's maximum force by the time the piston is ready to move back down in the cylinder. This may seem weird in the sense that the explosion takes place so quickly, but if you think about how fast the piston is moving (at 3000 rpm, the ignition fires 25 times per second). Pinging occurs when the ignition of the air/fuel occurs before it is supposed to. This can be caused by a hot spot in the combustion chamber (carbon buildup for instance), by the spark occurring too soon, or when the compression ratio is too high for the fuel. As fuel is harder to burn as the octane goes up, it becomes more stable and less likely to burn before it's supposed to. If lower octane fuel is introduced into an engine, the air/fuel will most likely try to burn before it's supposed to and causing the preignition otherwise known as "ping" or "knock". This will be read by the knock sensor and the computer will pull timing out of the cylinder (or cylinders if multiple occurrences) which is having the issue. When I say "pull timing out", I mean to say, the spark will be made not as advanced. For instance, if there is 36 degrees advance - spark occurring 36 degrees Before TDC - the computer may make it only 34 or 32 degrees BTDC. The main effect this has is to reduce the power output of the engine -- the engine will not be as efficient.
When you mix different octanes of fuel, you are either increasing or decreasing the octane of the fuel at hand. It won't cause any real problems for the engine or fuel system at hand (this assumes you are using fuels of the same mixture of ethanol -- mixing E85 fuel into standard fuel to increase octane and introducing it into a fuel system which cannot handle it - read this -- may cause issues with seals and corrosion of parts which are not built to take the higher concentration of ethanol. E10 fuel poses no issues for modern or older vehicles).
As for diesel, it is unlikely that major engine damage would occur due to "hydraulicing" (term used when a large amount of fluid is introduced into a cylinder) as Juann suggests, only because the engine would not run if pure diesel were introduced. A small amount of diesel would be in the cylinder, but not enough to cause damage. It is possible for a mix of diesel and gas to fire, depending on the mix. It would have to be a lot more gas than diesel, but I don't know what the maximum ratio of diesel would be for it to run. Mind you, it would not run as well as straight gas in a vehicle, but theoretically it could run. You'd see a lot of smoke out of your tail pipe (either blue or black) and it would eventually clog your catalytic convertor. So, not a death sentence, but definitely not good for your car.