That's not actually correct. MAME intends to be as accurate as possible (we emulate the actual microcontrollers running the actual firmware inside the keyboards for PC, AT, and PS/2 keyboards as one example) but it's not always there.
Sega Genesis is a poor example; MAME runs the entire commercially released library fine, but some homebrew stuff that seeks to stretch or break the hardware doesn't do well (notably the Titan demos).
On the other hand, MAME's 8-bit Apple II emulation is cycle-accurate and you can raster-split mid-scanline by counting cycles (as some people crazier than me have done). So it really depends on the specific driver.
MAME emulates the SID but the code dates back to like 2004 and doesn't sound anywhere near as good as the modern SID emulation engines. We prefer BSD or MIT licensed components to GPL ones so there's been some hesitation to just grab one of the popular SID engines (and our base C64 emulation is generally decent if you aren't trying to break the hardware like most demos, but it's also slow because the mapper PLA is emulated in the hot path).
The main issue is that in MAME's normal operation it waits for the start of a new video frame, runs all the emulation as quickly as possible, and then sleeps the rest of the frame time. (so-called "hurry to sleep" that became a big deal on phones). That works fine for games and computers and even Game and Watches, but it introduces lag when talking to the outside world.
Even that is OK for serial/parallel and Ethernet comms with emulated machines, but MIDI is a special case where there's enough lag between pressing a key and hearing it that even crappy players like myself get completely discombobulated.
You can record what you want separately as a MIDI sequence and then play it through the synth in MAME to get a .WAV you can paste into a DAW, but MAME as a real-time workflow isn't there yet. Our basic plan is to increase the "frame rate" for synths significantly (to something like 240 Hz) but there are of course complications with that that we need to work through.
Sega Genesis is a poor example; MAME runs the entire commercially released library fine, but some homebrew stuff that seeks to stretch or break the hardware doesn't do well (notably the Titan demos).
On the other hand, MAME's 8-bit Apple II emulation is cycle-accurate and you can raster-split mid-scanline by counting cycles (as some people crazier than me have done). So it really depends on the specific driver.