If I remember my Chemistry correctly, the lower octane gas will NOT harm your car. My only suggestion is do not drive it hard on lower octane gas. The motor is designed for performance, thus the need for higher octane fuel.
You will have no damage to the motor by using lower octane (within reason) fuels in the tank as long as you do not drive like you're on a NASCAR track or try to race the teen-agers at the red light.
87 and 89 octane should be fine for highway driving or leisure driving... If you are stop and go in town, and runnig the A/C you should consider staying with the higher (90+) octane fuel.
In answer to your main question, fuel is fuel and the energy produced by burning it is constant, regardless of octane rating, provided it is burned in similar conditions... ie. same engine. Higher octane ratings do, however, burn more efficiently, thus reducing knocking and pre-ignition 'ping'.
76 240D - 550K miles
78 300D - 200K+ miles