A pun is otherwise known as a play on words and is often when one character says something that is deliberately misinterpreted by another character, who shows his or her wit by doing this. We can see this in play in the very first exchange between Petruchio and Grumio in Act I scene 2, as Petrucio enters and asks his erstwhile servant to "knock" on the door of Hortensio's house to altert him to their arrival. Note how Grumio responds:
Knock, sir? Whom should I knock? Is there any man has rebused your worship?
Of course, Grumio is wilfully misinterpreting the word "knock," taking it to mean hit or punch, which is why he asks "whom" he should "knock" and if there is anyone who has insulted Petruchio. Grumio seems to play the stereotypical role of a witty Shakesperian servant who engages in such banter with his master, who is not much better.
Puns are a form of humorous word play where the individual uses a word which has different meanings to create humor by using one of the meanings of the word in the phrase.
The first few conversational exchanges between Petruchio and Grumio after arriving at Hortensio are pun intended. Petruchio asks Grumio to knock on the door but because Petruchio was not explicit and just asked Grumio to knock, Grumio took the opportunity to joke by asking Petruchio who he should knock. “Knock, sir! Whom should I knock? Is there man has rebused your worship?” this statement is followed by a humorous conversation between the two. Petruchio responds wittily by stating that if Grumio does not knock on the gate he would knock him out “Villain, I say, knock me at this gate And rap me well, or I'll knock your knave's pate.”
The word "knock" is being used humorously in the conversation to wrongfully imply the action of punching someone.