It could be done using a javascript/webassembly mega drive emulator.
I found this (http://neptunjs.xyz/segaMD.html) but there are others.
I did something similar with my Gameboy game: https://nekete.itch.io/a-fairy-without-wings