Typically the difference between an engine of a rocket and a rocket is the engine only encompasses the injectors and control of those ejectors. Arguably, any control over the nozzle direction would also come under "engine" but it's a fuzzy line.
A rough breakdown of a rocket propulsion system is: fuel storage, piping, injectors, combustion chamber, nozzle. So lets go through them 1 by 1.
Fuel storage: this is your tanks. Now different fuels have different densities, and for a given pressure rated tank you will be able to hold a different amount of liquid from one fuel to the next. Also different fuels can react with the tanks inner walls in different ways. Further to this, helium (I know this isn't hydrogen but it's for example purposes) can actually leak through aluminium. So you can see there are a lot of issues with this, but none of them rule out using different fuels.
Piping: very similar to your fuel tank, we'll bundle valves into this section as well. Aside from the solid/fluid interactions that we discussed with the tank there's a couple of other issues with the piping. It needs to be big enough to let the right amount of fuel through, which means making it big enough for the fuel that requires the largest diameter piping, but then you are potentially over flowing the other fuels. Still, using the engine at some reduced efficiency would still qualify as using it!
Injectors: as I understand it the injectors are to mix and ignite the fuel. I would imagine (could be wrong here) that these things are designed bespoke for the fuel. The fluid mechanics of it are likely to be a nice complicated task, but again if we don't mix well but still ignite then we'll just have a reduced efficiency!
Combustion chamber: this is very similar to the issues related to the injectors, just to a lesser extent I would imagine.
Nozzle: this is a tricky one. The purpose of the nozzle is to turn the heat into speed. Now an ideal nozzle converges up to the point where the the exhaust reaches mach 1, and then diverges (subsonic fluid flow increases in speed through a convergent nozzle, supersonic is the opposite). I see no reason why you couldn't make the convergent part of your nozzle long enough for the exhaust that requires the maximum length, since you would just get a reduced efficiency from the other exhausts!
So in summary, I see no reason why it wouldn't work. You might just get a large reduction in efficiency, meaning more propellant being required for a specific delta V.