Some TV shows ended on the note that their whole multi-year run, with plots and twists and characters that came and went, was all just one of the character's dream. For example St. Elsewhere in 1988 and Newhart in 1990. That's all I can think of offhand though.