The Doctor Who episode “The Gunfighters” is a light-hearted one with lots of comedy. The Doctor and his companions end up in Tombstone in the wild West. There the Doctor gets mistaken for Doc Holliday and deputized by Wyatt Earp (whom he persistently refers to as “Mr. Wearp”) while Stephen and Dodo are forced to offer musical entertainment at the Last Chance Saloon. Since this is an episode which survives, you can watch that scene on YouTube or in the video embedded below.
The other main point to note is that in this episode, although the Doctor did not yet think that Stetsons are cool, he did wear one nevertheless.