Not only is this a sensible idea, it's also just a fancy way of running in an emulator like you would for another game.
Now I'm wondering if you could put e.g. a Windows virus into a Gameboy game, such that if someone did the opposite of what we're talking about and ran it "natively" then they'd be infected. Afaik this kind of native execution as an alternative to emulation is being done via recompilation projects - see e.g.
NES - https://andrewkelley.me/post/jamulator.html
N64 - https://deepwiki.com/Zelda64Recomp/Zelda64Recomp/3.1-recompi...