It depends on what you choose to consider as energy.
Using mass-energy equivalence as your logic seems to be, then theoretically two objects of the exact same mass will have the exact same energy.
If we want to consider how we will extract this energy, most would say that gasoline has more available energy than wood. That is to say, we don't usually convert wood or fuel into pure energy (this would be impossible with our current technology AFAIK).
When we talk about the energy in fuel sources like this, we generally mean the usable energy; which we put into practical limits of how we can extract the energy.
The common example for wood and gasoline is by burning them. This is a chemical reaction that takes energy that was bonding the molecules and instead the bonds are reformed in a lower energy state, releasing the difference (mostly as heat). It requires a bit of heat to start this reaction; but then the heat generated from the reaction is enough to keep the reaction going as long as their is enough oxygen.
Releasing this chemical energy will lower the masses slightly; but the mass-energy equivalence makes it so that this mass change is quite small compared to the mass of the combustibles (because in the end of these reactions you still have molecules which still have mass, so you will not be extracting all the energy from the mass-energy equivalence principle).