It’s always legal to download any game you already own in some form or another including ROMs. For other games, it depends. To download some of them are completely legal for they were never properly copyrighted; while the copyright of many others has gone kaput due to legal disputes, business-related loopholes, or bankruptcy. However, downloading or sharing copyright-protected ROMs online is illegal and forbidden.