Conway's Polyglot: 1K file runs Game of Life both in the browser and on a C64
hexatomium.github.io
hexatomium.github.io
The C64 doesn't care at all what it loads. It just treats the first two bytes as an address to load the data into (not used unless you explicitly request it with an extra flag when loading). So it loads the whole file, excluding the first two bytes but including the html/js, straight into memory.
The browser, on the other hand, accepts pretty much any junk prior to the body tag and ignores it.
So this is just one of those cases where two formats can pretty much just be concatenated.
It'd be fun to use the same mechanism to have the two programs e.g. share data tables.
By the way, a simple way to test it if you don't have a real C64 at hand is using the CCS64 emulator: Just drag and drop the .PRG file onto it.
Interesting, but nowhere near as amazing as if you e.g. made a file that somehow both was a valid C64 binary and valid browser-interpretable (HTML/JS/whatever) file.