There is no pure energy generator. All the generators are transforming one form of energy to another. The chemical energy from gasoline is transformed to heat (thermal energy) + mechanical energy + other forms of chemical energy (CO, CO2 and others). The mechanical energy is then transformed into more heat and electric energy (if we're talking about an electrical generator).
What makes gasoline a good energy "producer" is the simple way the chemical energy can be released and the percentage of usable energy (the efficiency of the generator). What makes other substances bad energy producers is the efficiency and complexity of changing the energy to usable energy (like mechanical or electrical energy).