In the movie E.T. the Extra-Terrestrial, two characters are talking and one refers to something from Star Trek.
Here is the lines from that dialogue (source IMDB),
Elliott: He's a man from outer space and we're taking him to his spaceship.
Greg: Well, can't he just beam up?
Elliott: This is reality, Greg.
So a fictional movie is referring to another fictional story. Is there a term for this?