Phrase Finder has an article on “Pardon my French” or “Excuse my French.”
“A coy phrase used when someone who has used a swear-word attempts to pass it off as French. The coyness comes from the fact the both the speaker and listener are of course both well aware the swear-word is indeed English… This usage is mid 20th century English in origin. A version of it is found in Michael Harrison’s All Trees were Green, 1936.
“The source of the phrase is earlier and derives from a literal usage of the exclamation. In the 19th century, when English people used French expressions in conversation…For example, in The Lady’s Magazine, 1830: When a speaker says something rude about her compatriot’s appearance, then apologized for doing so in French, but not for the rudeness itself.”
Today I Found Out presents a lengthy list of conflicts between France and England that might lead to English speakers ascribing curse words to French.