Is there a term for when fiction refers to fiction
Allusion, may be the term you are looking for.
Allusion is a brief and indirect reference to a person, place, thing or idea of historical, cultural, literary or political significance. It does not describe in detail the person or thing to which it refers. It is just a passing comment and the writer expects the reader to possess enough knowledge to spot the allusion and grasp its importance in a text. https://literarydevices.net/allusion/
While it does include things other than fiction for possible references, it's still fairly specific. The example you provided falls well within this definition. Perhaps "literary allusion" would be more fitting.
I think Allusion is the best term for this scenario, but there can be other world-breaking type of scenarios. I adore MetaFiction, so the link to Intertextuality is a good starting place, and if you have time, yes, TV Tropes can show you a zillion parallels.
Some more things to explore:
- https://en.wikipedia.org/wiki/Meta
- https://en.wikipedia.org/wiki/Fourth_wall
- https://en.wikipedia.org/wiki/Meta-reference
- https://en.wikipedia.org/wiki/Hypostasis_(literature) (this was averted -- the characters in E.T. still believe they are "real" -- but if not, could they cross fictional paths and use a transporter?
- https://en.wikipedia.org/wiki/Experimental_literature