Is it energetically feasible to run a diesel engine on diesel fuel combusted with oxygen derived from electrolysis of water, driven from the engine itself? Although there's no fundamental thermodynamic reason such a thing is impossible, presumably it isn't, or military diesel submarines would do it.
NEL Hydrogen claims their commercially available electrolysis apparatus electrolyzes hydrogen gas from seawater at 49 kWh/m³ at STP; this presumably means it also produces oxygen from water at about 98 kWh/m³, which at 1.429 g/ℓ is about 68.6 kWh/kg. This is 247 MJ/kg, which is about 6× the specific energy from burning common fuels such as diesel fuel (43 MJ/kg) with oxygen.
It gets worse, though, because burning those fuels requires a much larger amount of oxygen than the fuel: a CH2 unit, weighing 14 daltons, becomes a CO2 molecule and an H2O molecule, using 48 daltons of oxygen. So actually burning diesel fuel gives you 43 MJ per kg of diesel, but only 43 × 14 ÷ 48 = 12.5 MJ per kg of oxygen. So you only get back about 5% of the electrolysis energy when you use the oxygen. That's really, really far from being viable.
So you can't run a diesel engine on water and diesel fuel.
There are things that have such a strong affinity for oxygen that you can burn them with oxygen from water for a net energy gain; sodium is probably the best-known example. As far as I know, all of them pose serious practical problems for use in a heat engine.