In the end of the Get Smart episode "The Not So Great Escape", Control agents whistle the theme song as they leave the Kaos prison camp.
On The Fall Guy, Howie is reading the lyrics to a song he wrote (the show's theme song, "The Unknown Stuntman"). During the show, Colt and Howie make a bet where Colt says he'll sing the song live on stage if he loses. He does.
Classic example: In I Love Lucy, one episode has Lucy certain that Ricky has forgotten her birthday. She makes her way to the nightclub where he works, where he assures her he has not forgotten and sings the show's theme song to her, Forgotten Theme Tune Lyrics and all.
A classic example occurred in Green Acres. At the start of the episode, we see Eb going off to do his chores while whistling the theme song. He then turns and looks straight at the camera to say the line "Dahling, I love you, but give me Park Avenue" in Lisa's voice.
Drake & Josh: In the episode "First Crush", Drake Parker sings the show's theme song ("I Found a Way" by Drake Bell, who played him on the show) until a snake appears on his shoulder and gets thrown into the audience.
Zoey 101: In "Back to PCA", "Follow Me" by Jamie Lynn Spears, the show's theme, is heard during the final scene.
iCarly: Carly was playing short chords of "Leave It All To Me" on her ukelele.
At the end of the Victorious crossover "iParty With Victorious", the cast of both shows sing a mashed up version of both theme songs.
In an episode of Mad About You, Paul walks past an A Cappella group singing the theme song, which he'd cowritten. To further mess with the wall, he mentions its familiarity. At the end of the episode, Paul and Jamie listen to the same group singing the theme again as the end-credits play. This time, Paul recognizes the tune and grins with satisfaction, but does not identify the tune out loud.
My Two Dads had one episode where the theme song was performed by Evigan (the other Dad of the title) and... special guest Davy Jones of The Monkees.
An episode of Pretty Guardian Sailor Moon has the characters doing karaoke with, and later synchronizing their attacks to, a song by Minako Aino, who later turns out to be Sailor Venus (the song, incidentally, repeats the phrase "C'est la vie", which sounds pretty much like "Sailor V" in Japanese) and which song is available on the soundtrack albums. (All the soundtrack albums. Sometimes more than once.)
Tweenies: In one ep, some character has a blow-up guitar balloon and is singing, "Hey, hey, are you ready to play?"... the first line of the show's theme tune.
The opening scene of the first episode of The Young Ones has Rick rocking out to the show's theme song. Somewhat justified since the song predates the show, though the fact that he was explicitly listening to the cover version sung by the actors from the show creates a bit of a Celebrity Paradox.
"This Old Man", which in the later years of Columbo was sometimes used as unofficial theme music (the show never really had a theme as such) also appears in a lot of episodes in some form, usually being hummed or whistled by the title character.
With a twist. Battlestar Galactica (2005) uses the theme music not from that series, but from the original Battlestar Galactica, as what appears to be the Colonial anthem. In the pilot, an honor guard play it at Galactica's decommissioning ceremony. In the episode "Final Cut", it underscores the patriotic ending sequence of a Show Within a Show documentary. And one more time in the final episode when the fleet is auto-piloted into the heart of the sun.
"Chimera". Carter hums the SG-1 theme music in the elevator, prompting O'Neill to deduce that she has a new boyfriend. Word of God has it that the actress actually wanted to hum MacGyver's theme music as a nod, but she completely forgot the notes so she hummed the Stargate theme instead.
The episode "200", which is rife with self-reference, features the hypothetical wedding of Carter and O'Neill. The music in the background begins with Here Comes The Bride, but segues into the SG-1 theme.
In a related matter, the SG-1 theme also appears in the BGM of the Stargate Atlantis episode "Home" when the main characters arrive back on Earth.
SG-1 returns the favor by using the Atlantis theme in "The Pegasus Project," when SG-1 visit Atlantis.
The opening in the episode "Leclerc Against the Wall" featured the usual opening shot of Rene in his cafe as the instrumental theme song plays. It fades out as Rene begins playing the exact same song on the cafe piano.
In another episode an accordionist is heard wandering the town square outside the cafe, playing a slower version of the theme on his accordion.
Veronica Mars: At the close of The Teaser to one episode, Veronica wryly notes of an estranged acquaintance, "We used to be friends, a long time ago," the opening words (inverted) of the show's Theme Tune.
On WKRP in Cincinnati, during one episode recounting events prior to the start of the series ("The Creation of Venus"), Andy explains that he'd come to Cincinnati because he'd "gotten kind of tired of packing and unpacking, town to town, up and down the dial" — the same explanation offered in the theme song. He lightly lampshades this by saying it as if he were alluding to well-known words.
In The Fresh Prince of Bel-Air, while giving his testimony at the bench during a court case, Will falls into the/his lyrics when introducing himself.
The original 1963 recording of the theme cameos in the first episode of K9 within K9's memories.
The serial "Paradise Towers" had a Muzak version of the theme music playing in an elevator.
"Vale Decem" in The End of Time is being sung by the Ood as the song they promised him. Just as 10 is beginning to regenerate, they shift into a triumphant/heartwrenching version of "The Doctor's Theme."
A cello trio is playing Martha's theme in The Lazarus Experiment.
WindWave Radio in Kamen Rider Double when left on tends to play various bits of music including the eponymous hero's battle themes, all of which were written by fictitious bands from the show.
Episodes 21 and 22 has a whistling tune of "Cyclone Effect" — one of said battle themes - play a part of the case. Philip and Shotaro sing "Finger on the Trigger" in episode 23 in Fuuuuuutic Idol, their equivalent of American Idol.
As an added bonus, the judges on Fuuuuuutic Idol are the two singers of the opening theme, and another singer of tokusatsu and anime themes.
Sonozaki Ryubee is also seen idly humming his own theme music.
In the finale for season one of Smallville, the band that plays the show's theme song (Remy Zero) is playing at the Smallville High prom. And what do they play? Yup. You got it.
When Dr. Swann (former Superman actor Christopher Reeve, of course) tells Clark he's from a place called Krypton — this being the first time the name is mentioned, a few years into the series — we suddenly hear one of the fanfares from Reeve's movie series.
The Jeremy Brett Sherlock Holmes episode The Creeping Man has Holmes listening to the TV show's theme tune on a music box. Since most readers despise the original short story, this rare bit of levity seems appropriate.
One episode of The Adventures of Sherlock Holmes ends with Holmes beginning to play the series' theme tune on his violin.
The series did this a few times as well. 'Who Wants to Live Forever' played after Fitz's death in 'Star-Crossed' and when Duncan was recalling Tessa later in season 2. A snippet of 'Princes of the Universe' played during the Training Montage in 'Eye for an Eye'.
Midsomer Murders does this all the time — mostly at fairs or festivals. Mediums playing the theme include a brass band, a youth orchestra, and a marching band.
In "Fascination" in the third season of Star Trek: Deep Space Nine, Odo conducts a bajoran band playing a hardly recognizable version of the theme song.
One Joan of Arcadia teaser has God singing (a humorously bad, given the character) version of Joan Osbourne's "One of Us," which was appropriated as the show's theme song. This segued directly into the credits.
In the Growing Pains episode "All The World's a Stage", Mike Seaver and his choir sing the opening theme song — and it serves as the theme song for that episode.
The original title theme of Monk by Jeff Beal, which was since replaced with It's a Jungle Out There (Randy Newman), has since often come up in the show as background music, usually in dramatic scenes or those having to do with memories. In one memorable instance, however, Randy Disher plays the song on a piano. When Stottlemeyer asks him what he's doing, Disher says "background music".
In one episode of Hogan's Heroes, the Heroes pretend to escape so an Italian spy can "capture" them. When he marches them back into camp, they're all whistling the show's theme song.
In Season 1 of Upstairs Downstairs, Sarah performs the Downstairs theme as a Bawdy Song ("What Are We Going to Do with Uncle Arthur?") in her music hall act. For Equal Time, the stately waltz of the Upstairs theme is played on the organ at Elizabeths wedding.
The episode "Frannie's Choice" ended with Fran describing how she got to her current station in life by reciting the lyrics of the opening theme.
In "Strange Bedfellows", Fran notices similarities between her and a fellow nanny that was going to be fired since the kids had grown up, the other nanny begins to describe that the way she got the job with the opening theme as well.
Yet another example was in "Fashion Show", when Fran was describing her fashion sense with "I've got style, I've got flare, that's how I became (Beat) the nanny"
The lost culture in the Farscape two-parter "What Was Lost" chanted the series theme as they sacrificed goats. This may have been foreshadowing the larger role, plotwise and thematically, that they would play in the miniseries.
In the episode "Losing Time", John can also be heard humming along to the background music while walking through Moya's corridors.
In the Red Dwarf Western-VR episode "Gunmen of the Apocalypse", the piano in the Last Chance Saloon is playing the theme as the main characters enter.
In Back to Earth, a haunting rendition of the theme tune is played by the Creator's doorbell.
An episode of Lois & Clark has Clark whistling the theme tune.
A scene in Scrubs starts with JD and Turk walking in, singing the theme tune (Superman by Lazlo Bane).
While not being sung, in a later episode Doctor Kelso is seen talking with some beach babes, saying to them "... I can't do this all my own!"
"Guy Love", which only really existed as part of an aneurysm induced hallucination, nevertheless shows up as Turk's ringtone in a later episode.
JD and Turk also beatbox the themesong when they're gloating about diagnosing one of Dr. Cox's problem patients.
And when Elliot puts one of those electronic "piano carpets" at her door, JD walks in and starts dancing around on it. Guess what he plays.
JD: Hmm. Catchy!
The drumbeat at the start of the theme tune, always played onscreen before it actually goes into the titles, is played by a character on a couple of occasions. In My Office JD plays it out by bursting bubblewrap and in My Best Friend's Baby's Baby and My Baby's Baby it's done by a drummer in a marching band.
On Dallas several members of the Ewing family (Bobby, Pam and Lucy) as well as Ray Krebbs went to a disco, where the DJ started playing the Dallas theme tune.
Xena: Warrior Princess: Xena played the theme song in one episode (on a lyre that sounded surprisingly like an electric guitar). Another time, she whistles it while fishing.
Big Wolf on Campus has Merton trying to compose a song on a piano, that is actually the show's theme tune. It's a double reference as the actor who plays Merton created the theme tune in real life. Unlike a lot of other examples of this trope, the song Merton writes actually has vital plot relevance later in the episode.
In The L Word, every single tune you hear is some kind of adaptation of the theme music. It's exactly as annoying as you'd think.
Another toku example: In one episode of Warrior of Love Rainbowman, hero Takeshi Yamato sings the ED theme, which is his theme song.
In the very early episodes of The Beverly Hillbillies, the balladeer not only sings the theme song, but sings new lyrics to reflect the on-screen action, in part a feud between the Clampetts and the Drysdales.
In "Jed Throws A Wingding", two old friends of the Clampett family write a song about Jed, which turns out to be the theme song.
The two friends are musicians Lester Flatts and Earl Scruggs who provided the music for the theme song.
Kate's ringtone is a version of the themesong in a season 2 episode of NCIS.
Played with on The Big Bang Theory: Howard's cellphone ringtone is the song that was used as the theme tune... in the unaired pilot.
In an instance which was bound to happen eventually because of the show's format (sing a song as karaoke, then correctly guess the next line when prompted), Dont Forget the Lyrics offered its own theme song (the Doobie Brothers' "China Grove") alongside the theme of Green Acres in a "TV Themes" category. Unfortunately, the clueless contestant, despite claiming she had never watched it, went with Green Acres, and promptly lost.
In The Middleman, the Muzak playing in the lobby of the Jolly Fats Wehawkin Employment Agency (the front for the Middle organization) was based on the show's theme.
In Castle, the title character occasionally hums the show's standard "exciting things are happening now" background music to himself.
In "Last Call", as he enters an old drinking establishment he used to frequent, the piano man starts playing that same riff. Castle tips him for remembering.
In one episode of Made in Canada, one of the characters sings the theme song during a party; in another, the song is heard playing on a CD player.
The New Girl pilot has Jess singing the theme song at one point. The standard opening credits don't show up until the second episode, making this a Theme Tune Early-Bird Cameo of sorts.
In the second The Wild Wild West TV movie, More Wild Wild West, Artemus Gordon hums the main theme from the show while getting ready in front of a mirror.
In the Psych episode "The Amazing Psych Man & Tap-Man, Issue #2", Shawn tells Juliet "I know you know I'm not telling the truth. I know...you know...".
The Office (UK) episode "Training" ends with David Brent singing and playing the theme song, "Handrags and Gladrags", on guitar. (Kind of justified in-universe, in that it's a song that predates the series, and presumably was part of the repertoire of Brent's old band Foregone Conclusion, which is discussed in the episode.)
The Tribe: Sasha plays the theme from The Tribe on his flute in his first episode as an official Mall Rat. A few episodes earlier, the piece of music Tai San uses during her dance routine is the same incidental music used during establishing shots.
In Teen Wolf, season 2 episode 12, "Master Plan", the opening credits/theme song is heard during the fight scene involving Derek, Scott, Isaac, Jackson, and Allison.
Game of Thrones has a lot of fun playing with the fact that the song "The Rains of Castamere" is both the in-universe favorite song of the Lannister family and a frequent soundtrack motif and sometimes end credit theme for the show. It was easter egged as a tune that Tyrion was whistling and as background music in several scenes before viewers ever heard the lyrics or found out why the song was important.
The proper theme of the show is used as well. For the introduction of the Night King and the later battles in Season 4, it is used to indicate a foreboding sense of doom.
In the Pretty Little Liars episode "Over My Dead Body," Emily has a carbon-monoxide-induced hallucination that she's talking to Alison; when she asks who "A" is, Alison's reply quotes the opening song "Secrets" - "Two can keep a secret if one of them is dead."
Mr. Lucky's watch plays the first five notes of the show's theme tune - his theme - when opened.
One episode of Absolutely Fabulous had Edina and Patsy sing a (drunk, naturally) karaoke version of "This Wheel's on Fire", originally by the Band. Julie Driscoll got a UK hit out of covering it in 1968; she and Adrian Edmondson recorded a new version of the cover for the show's theme.
In the series finalé of Dawson's Creek, Jen is shown a video that Dawson supposedly made back in season 1; it's a slight re-working of the show's original credits, including the original theme tune. ("One Hand In My Pocket" by Alanis Morissette)
In Cranford, the music for the waltz at the end of Return to Cranford is the Instrumental Theme Tune of the series, albeit in 3/4 time (the original was in 4/4). It's called "Cranford Waltz".
During one MythBusters episode, Adam and Jamie were using underwater speakers to test whether sharks were attracted to sounds of a certain pitch. To test the speakers, Adam played the show's theme tune while Jamie, underwater in a shark cage, listened... then started dancing to it.
A few episodes later, when Barney declares himself the leader of the gang, an alternate version of the theme, sung by Barney and featuring pictures prominently featuring Barney and a disgruntled Ted and Robin in place of the normal pictures, is played, despite having already played the normal version of the theme in that episode. Later in the same episode, a third version is played, featuring Better Lily and New Marshall.
One Tree Hill has several cameos of "I Don't Wanna Be" most notably the cast singing along near the end.
On an episode of The Love Boat, a character named April (played by Charo) sings the show's theme song in the ship's nightclub.
On The Brady Bunch episode The Drummer Boy, Bobby is heard playing the trumpet in the backyard early in the morning, apparently attempting to play Reveille. But all he plays is cacophony, until he suddenly breaks into a flawless trumpet version of part of the Brady Bunch theme. This doubled as commercial bumper music, however.
In Detectorists, the central characters perform a self-penned song at an open mic night. The act on before them is "Johnny Piper", alias real-life folk singer Johnny Flynn, performing the show's theme song.
Della Wells and Josh Alexander sing Kylie Minogue's Always and Forever, Night and Day's theme tune, to one another during the final episode.
In one of the ad bumpers for Eureeka's Castle, the slurms (claymation worm-like creatures who live in Magellan the dragon's room) can be heard singing the song.
In another, Mr. Knack (the trader/fixer character) does one in the form of a knock-knock joke:
"Knock-knock. Who's there? You. Eureeka!"
The theme for The X-Files is used as Mulder's ringtone in the episode "Mulder and Scully Meet the Were-Monster".
In season seven of 30 Rock, Liz starts an episode by singing an impromptu song about how she and Criss just got married in the previous episode, set to the show's theme tune.
In the Batman episode "The Pharaoh's in a Rut", King Tut calls for "bat-music". A henchman sets a gramophone in motion, and we hear a brass-enhanced version of the show's theme.
Bill Nye the Science Guy: In the episode on "Motion", every time Bill or somebody else mentions inertia, the line "inertia is a property of matter." from the theme song plays.
On Unbreakable Kimmy Schmidt, a gospel version of the theme song makes an appearance, with the line "them females are strong as hell" replaced by "Jesus is strong as hell."
It is a major plot point in the pilot episode of Game Shakers. The song is first heard when Babe and Kenzie are on the subway. This leads to the song becoming the background music on their game Sky Whale, which they put online. This leads to a lawsuit by Dub for stealing their music, but also leads to a partnership, and at the party, Dub sings the song.
The Defenders (2017): When Matt Murdock and Jessica Jones (2015) are at John Raymond's brownstone, Matt goes over to the piano and plays a small excerpt of the title credits music, which is how they uncover plans Raymond had to blow up the Hand's base at Midland Circle.
In one episode in season 1, Paula explains to her husband what Rebecca's 'deal' is, and quotes line-for-line the Expository Theme Tune. When the theme tune sings the show's title, Scott himself accuses Rebecca of that, and Rebecca's objections in the theme tune ("That's a sexist term!") are said by Paula.
Also, most episodes of season 1 found a way to segue into the theme tune by having someone ask Rebecca or just wonder what it is that took her to West Covina, which the tune helpfully explains.
Season 2 gets a very brief one at the end when Rebecca's mother quotes that season's theme ("She's just a girl in love, she can't be held responsible for her actions.") in a flashback during Rebecca's trial.
Season 3's theme tune features a number of figures styled on different popular music genres giving conflicting advice about whether being crazy is good or bad, and ends with a shot of Rebecca on a toilet in a yellow dress mouthing 'What?' Later in the season after Rebecca receives her diagnosis, she is seen exiting the toilet wearing that same dress, taking earbuds out of her ears, clearly immediately after that final shot.
Later in season 3, Nathaniel accuses Rebecca of being crazy and she smirks, and that is when the theme tune plays for that episode, beginning with the very scene-appropriate "Crazy's when I go off the rails / This is what you've done to me."
The Partridge Family perform performs the Season One opening theme, "When We're Singin'," while on tour in Paris in "Mom Drops Out."
El corazón nunca se equivoca: since "Es Por Ti" was written in-universe by Ari, he and Temo decide to sing it while waiting for their laundry to be done in episode 6.
Not quite the theme music, but Edward Nygma from Gotham used the scene-transition riff from the 1960s Batman TV series as his personal cell phone's ringtone.
The Incredible Hulk (1977) episode "Alice in Discoland" had a disco version of the main title theme playing as Damsel-in-Distress of the week, Alice, was dancing at a club.
Some kids sing a part of the theme tune in episode 24 of the 4Kids English dub of Ultraman Tiga.