With the Saturn V rocket, NASA used fuel cells to power the Apollo missions and the Space Shuttle program, since they provided a reliable and ample amount of energy and drinking water for the crew.
Fuel cells work on the same principle as a battery with the addition of a catalyst to increase the efficiency of the reaction, and all three products of the fuel cell reaction can be used; the electricity, the heat, and the water.
There have been multiple fuel cell cars produced, including prototypes, production models, busses, and trains, but a common issue that these transportation fuel cell vehicles face is not having enough fueling stations for them to be convenient for everyday use.
Fuel cells have also been used to provide power and drinking water for submarines, and provide power to some homes, but are not yet widespread enough to be considered common.
The only barrier for fuel cells to become a more common form of energy is that the hydrogen and oxygen needed for the reaction must be provided, and transporting these can be difficult and dangerous.