MIDI is not a type of software, it's a standard for describing musical notes. A MIDI file is basically just a bunch of computer-readable notes, it doesn't really say anything about what kinds of instruments should be used to play them. If you tell your OS to "play" a MIDI file, it often uses some kind of pre-installed standard method, but what you're actually supposed to do with it is opening it in a digital audio workstation (DAW, e.g. Cubase, Logic, Ardour) or similar software and define the instruments yourself, and those instruments are generally based on plugins (e.g. using the VST or LV2 standard, as in "VST plugin"). In web development terms, MIDI is HTML, the OS's inbuilt MIDI players are the standard webbrowser CSS, and in a DAW you add CSS and JavaScript to make it look (sound) good.
For soundfonts you need a plugin that is capable of reading them. Those are available for Linux, but I haven't tried them yet (a lot of the time in Linux audio production, something basically exists, but works badly or is really complicated to set up).
Soundfonts really depend on the era. I think in the context of retro games, soundfonts are mostly used for 16bit games starting with the Super Nintendo, which usually had sample-based music as opposed to earlier consoles, which were usually synth-based. For synth-based retro music, on Windows there were a bunch of retro synth VSTs (plugins for DAWs), but I haven't looked into it since I switched to Linux (it's possible there are pretty much none). The other option is using tracker software (a different type of DAW) like LSDj, which runs on the console, in this case the Game Boy, for which you are creating the music. You can easily run software like that with console emulators. Not sure whether this kind of software exists for other consoles, though. I know that Famitracker doesn't run on the NES console, but it might be possible to run it through WINE. Though the native Game Boy and NES music tends to be pretty raw for modern ears, most people who make retro games will want to use something that's a bit more modern, possibly mix-and-matching the raw retro sounds with something modern. Which brings you back to the DAW.