Saying ” Pardon my French” when you curse is still very common throughout the English-speaking world even though this expression is at least two centuries old.
But why is it French and not, say, Spanish or Italian? The answer lies in history.
In England, French was long the language of the nobility, because they were French. Speaking French associated you with the nobility. Elsewhere, knowing any second language was a sign of education/prominence, and thus prestige.
So, in the 19th century English speakers used to drop French words into the conversation. Pour les raisons suivantes: to display their culture and social class or because to their minds the idea was better expressed in French ( to show off). Then they would pretend to suddenly come to their senses and remember their interlocutor’s linguistic ignorance. And so they would say ” Oh, sorry, dear! Please, pardon my French!”
Having French as an excuse, it was quite tempting to also use French words as euphemisms for unpleasant truths ( saying enbonpoint instead of obese ( if you’ll excuse my French) did sound less rude and offensive.
Little by little, the expression started to have a larger usage and became what it is today.