The Internet Archive, a non-profit organization dedicated to the preservation of "digital artifacts" now hosts a library of over 2000 classic games playable in your browser.
These games hail from a multitude of platforms; atari, nes, snes, sega, C64, coin-ups etc....you name it...most game platforms from the 80's or 90's are represented in this library in some shape or form. This amazing feat was achieved be leveraging emscripten, a highly optimized version of javascript to achieve emulation.
And yes all the games here are hosted legally.
Here are links to a polygon article on the topic and to the library itself:
POLYGON - Mega Man, The Lion King and over 2,000 free games are now playable in your browser
The internet Arcade
It's like a crazy trip down memory lane...but darn it makes me feel so old...