Homer's rant about deceased celebrities "appearing in commercials dancing with vacuum cleaners" is a reference to a 1997 TV advertisement that depicted the late Fred Astaire dancing with a Dirt Devil vacuum cleaner.
Apu's sandcastle is a very detailed replica of India's famous Taj Mahal.
Homer ranted about never seeing Ray Bolger (understood as the actor famous for his role The Scarecrow in the 1939 film The Wizard of Oz). Bolger passed away in 1987, which is why no one has seen him in a while.
This is the first episode where Lionel Hutz appeared after Phil Hartman's death. Hartman's characters, including Troy McClure, would have a non-speaking role in future episodes.
When Judge Snyder sentences Homer to the 500 miles away from celebrity verdict, it would mean that Homer Simpson and his family would have to live outside of the United States, because there is no plausible way that he can commit to the 500 miles punishment without being away from the country.
One gag near the end of the episode had a sign with the 20th Century Fox logo on it with the line "A Division of (the) Walt Disney Company" under it. On December 14, 2017, Disney would end up purchasing 20th Century Fox's parent company 21st Century Fox, which was completed on March 20, 2019, and will not affect The Simpsons in any way.