The Gemara on Amud Beis tells us a story about a Cohen Godol, who upon successfully and safely emerging from the Holy of Holies, had an encounter with Shmaya and Avtalyon, the rabbinic leaders of the generation:
The Sages taught in a baraisa: There was an incident involving one High Priest who exited the Holy Temple and everyone followed him. When they saw Shemaya and Avtalyon, the heads of the Sanhedrin, walking along, in deference to them they left the High Priest by himself and walked after Shemaya and Avtalyon. Eventually, Shemaya and Avtalyon came to take leave of the High Priest before returning to their homes. Envious of the attention they received, he angrily said to them: Let the descendants of the gentile nations come in peace. (Shemaya and Avtalyon descended from converts, and he scornfully drew attention to that fact.) They said to him: Let the descendants of the gentile nations come in peace, who perform the acts of Aaron, who loved and pursued peace; and let not a descendant of Aaron come in peace, who does not perform the acts of Aaron and who speaks condescendingly to descendants of converts.
Let us note the harshness of Shemaya and Avtalyon’s reply. While the Chida (Maris Ha-Ayin) defends their harshness as appropriate for kvod Hatorah, in truth anyone who is insulted may well be permitted to respond harshly.
The Chofets Chaim (באר מיים חיים (ח-ט) חפץ חיים פתיחה להלכות לשון הרע ורכילות, לאוין) cites an opinion that to fire insults back at the moment that someone else insults you is considered self-defense and not necessarily under the prohibition of hurtful speech, though it still is an extra pious act to show forbearance.
I will add that not all matters which are permissible, are advisable. This is especially relevant to interpersonal situations where the consequence of firing back a good zinger is a continuation of hostility. While Shmaya and Avtalyon may not have considered preserving a relationship with a chutzpahdik Cohen Godol to be worth keeping silent in the face of the disrespect to the rabbinic office, in every day life we are neither famous rabbis nor Cohen Godols. When we are insulted and we fire back, it might be understandable, forgivable and perhaps even permitted, but if we share the same home or even the same bed with that person what good will it do?