Key to each context is purpose - why we are having the conversation in the first place. Are we sharing gossip with friends in order to bond more tightly with our social group? Or boasting of some achievement in order to raise our status within that group? Are we giving or asking for important information? Are we persuading someone we are trustworthy so they will give us a job?
Changing the way we speak is an important way of building bridges in different social situations. Not responding to new contexts or people can cause problems. In the hands of comedians that means laughter.
Again, the humour comes from a number of sources. Firstly, because we don't expect anyone to be so rude. Especially when that person is running a hotel where the manager's job to be nice, polite and welcoming to guests.
Secondly, the only change in the way Fawlty speaks to the guest and the person on the phone is in degrees of rudeness. He orders the guest around without looking at him ("Yes? Your name... There, there... Both names please...") and is heavily sarcastic to the builder on the phone (note his comment about cementing the bricks together "in the traditional fashion").
Thirdly, the way he behaves does not change according to outside influences - until the guest mentions his name: Lord Melbury. We see Fawlty's incredible snobbery in action as he thinks he finally has a member of the British upper class staying at his hotel.
The first laugh comes from the way he dismisses O'Reilly on the phone - a pause then a simple "Go away!". Short, rude and so different from the standard language routines people traditionally employ at