Semi illegal...
JDM games are a grey area- they're not licensed for sale in the US, so they can technically be freely distributed. That's how fansub animes are legal to pass around until they're licensed for sale in the US.
Selling ROMs of games that have been licensed and sold in the US is another matter. Technically, as long as you already own a license for the game, you can have a backup. The ROM is your backup. The seller of the ROMs has no way of determining if you really do own the individual licenses for the game, so he just sells on "good faith" that you do have them. Nobody is going to bother to check your house or your receipts though.