You can run a combustion engine on hydrogen, but the compression ratio of gasoline engines is not optimal for hydrogen, it's optimal for gasoline. A higher compression ratio in the 13:1 or 14:1 range is more beneficial/efficient/etc
Making hydrogen out of water requires electricity. and a lot of it to get any quantity. You also have to devise a pumping mechanism to pressurize the hydrogen it draws from your separation/holding tank into whatever storage facility you've devised (usually an old welding bottle of some kind).
While hydrogen burns more efficiently than gasoline, making it is very inefficient but in a sense that's okay because what you're doing is creating "deferred pollution", meaning that you're not creating fumes in your backyard as you would by running a gasoline or diesel engine on your property.
The major eco-advantage of this is within city limits where everyone has such a vehicle, and the power plant is far, far away, outside the city limits. Pollution in the city will subside and the air will be much cleaner, a goal of every major city these days.
It's a fun experiment, and I'm not trying to discourage you in any way. I've done quite a few alternative fuel experiments myself with several friends and we learned a lot and had an awful lot of fun as well.
I and my friends have run old engines (gas and diesel) on everything from hydrogen to propane to acetelyne to Zep cleaning products.
Some worked, some died an early death, some exploded with great fanfare.
All, was fun ;-)