As mentioned by other posters, oxygen is not a fuel, it is an oxidizer, and as such, it will not be part of my reply.
Regarding coal, if you believe the geologists, coal is the product of a large amount of dead plant and animal material that was heated and compressed over vast time frames to squeeze it into carbon. This carbon started out as CO2 in the atmosphere, plants removed CO2 from the atmosphere in order to make cellulose, and the energy to generate cellulose from CO2 originated from sunlight. Since you can burn carbon to release energy and generate CO2, this means that ancient plants used the energy in sunlight to "unburn" the CO2 by collecting enough energy to separate carbon from oxygen as they were generating cellulose. It also means that there were biological processes that captured sunlight and stored the energy from that captured sunlight in a solid form that could later be mined and burned to release the stored energy for use by various heat engines.
Water is the chemical species that is produced by burning hydrogen in an oxygen atmosphere. To obtain a ready supply of hydrogen such as that seen with coal, biological processes would have had to take the energy of sunlight and use it to separate hydrogen from oxygen (aka, "unburn" the water). This necessarily requires those processes to be exposed to the surface of the earth, where sunlight is available. Unfortunately, hydrogen is the least dense gas in the periodic table, meaning that if such biological processes exist, the released oxygen is liberated to join other oxygen in the atmosphere, but the released hydrogen will quickly rise to the top of the atmosphere, where it will be unavailable to humans. This simply means that it is VERY unlikely that we will ever find large natural deposits of hydrogen.
Regarding the question of whether it's possible to use hydrogen to generate electricity, the answer is a definite "yes". However, to obtain that hydrogen, you either need to use methane reforming (methane is a fossil fuel) or you need to electrolyze water, preferably with solar cell electricity. The problem with electrolysis is the same problem that ALL energy conversions face: each energy conversion step is less than 100% efficient, and some conversions, such as electrolysis, are MUCH less than 100% efficient. Rather than use solar cell electricity to electrolyze water, it is much more efficient to store that energy in a battery for later use, and this is in fact the path that the energy industry is tending to pursue. This is probably a good thing, because there are several other problems with hydrogen, such as:
you have to compress hydrogen a LOT if you are going to store enough in a tank at ambient conditions to have a feasibly large amount. This takes a lot of energy (reducing efficiency) and requires thick walled equipment to contain it
if you want to liquify hydrogen in order to increase its stored density, you must keep it under VERY cold conditions in order to keep it below its critical temperature. This also takes a lot of energy and reduces efficiency
many metals become brittle as hydrogen molecules migrate into the grain boundaries between metal crystals, which is a BAD thing is you are trying to contain hydrogen under high pressure
For these and other reasons, hydrogen is a difficult gas to work with, and it's more efficient and far easier to store electrical energy in batteries.