This isn’t exactly an episode from a TV series, but one of the funniest I have ever seen was on the Tonight Show.
Joey Bishop was a guest host. Doug McClure was a guest on the show. McClure played a tough guy on a western. As they were sitting on the set engaged in conversation, somebody from the audience yells “McClure, you’re a hot dog!” McClure ignores him. He yells it again, and McClure looks out and yells for security. The guy does it again, and McClure jumps up, takes off his coat, and challenges the guy to come forward. The guy climbs up on stage and he and McClure start brawling. Bishop is going nuts. This goes on for a bit, Bishop is apoplectic, and then McClure and the guy start laughing their asses off. The whole thing was a gag and everybody except Bishop was in on it.
Of course the studio audience and the TV audience had no clue either.