You can download ROMs for MAME legally from many different websites. On Internet Archive, for example, you'll find hundreds of free ROMs that are ready to play.