This comes up every so often (more often than I like) and the actual bare-knuckle answer is pretty straight forward. ROMS are illegal..... in the U.S. (see if anyone notices that qualifier.)
What most people have issues wrapping their head around is just "how illegal is it?" why and where.
Like opinions, everyone
is has an ---uvula--- and in a forum with 100 people, you'll get 150 differing opinions on this particular subject, nearly all of them wrong, slightly wrong, or just so far off base that they're playing Moon Patrol from Mars. I'll try to bring up a couple of points and let the other
---uvulas--- forum members tear it apart and tell me how wrong I am.
* It depends on your country. but a general rule of thumb is that games enjoy the same legal protections as other works of art like books. Hence, the term copyright is often bandied about (though I doubt 90% of the population in the U.S. even knows what it really means). That means one has to consider when it was published, who owns it and what has been done with it by the owner. As a general rule of thumb, games created after 1978 will not have their copyright expire for 70 years plus life of author. For works for hire the copyright is 95 or 120 years depending on certain factors. Before 1978, it's 95 years. Did you get lost yet? Here it is, despite what anyone wants you to believe,
no game has had their copyright expire as no video games existed prior to 1923. Update: I forgot about the "28 year renewal" period only a very small handful of games are in public domain and I don't believe any are emulated in MAME anyways as these all predate 1964.
* Some authors have released their games into public domain to allow others to enjoy. These are few and listed on the MAME website. Some are vicious and will do anything to protect their games. Go look up the history of TETRIS to get an idea of how far someone will go. For the bulk of the games out there, it's often best to consider them as forgotten (this is not the same as abandon-ware) by whoever owns the copyrights.
* Finally, it's a risk assessment. Is Marijuana illegal in the U.S. Yes. Even medical MJ isn't recognized by the feds. So is it wise to take your MJM card down to Mexico or to a different state to try and buy pot? No, you're a ---smurfing--- moron for it. That happens because people get the cards and think it's a license to smoke and grow pot
anywhere. It doesn't work that way. MAME is like that. Want to install MAME in your own cab and play it in your own house? Sure, you'll probably not even get a flea to care as long as you're not trying to do other stupid things (like sharing 10,000 songs). But start trying to make money off it, or take it to a public place and your risk goes up. How much does your risk goes up? Depends. Take it to a flea market and it's never going to get noticed amongst all the fake purses, jeans and crack pipes. Set it up as a quarter muncher at E
3 and someone is bound to notice.
It depends on your cabinet... If your cabinet is "crapmame" worthy then it is very illegal, but if your cabinet is awesome then it is just a little illegal...
Post a pic of your rig and we can judge if it's "public exhibition" ready! 
Sweetest response I've heard in a long time.