Mozart wrote a canon in B-flat around 1782, meant to be sung by 6 voices. You can listen to it below.
The title is “Leck mich im Arsch”. We often think of Mozart, and other classical composers, as writing very formal pieces. The title of this work literally translates “Lick me in the ass”. But it probably more accurate to translate it as “Kiss my ass!”
He wrote a couple other dirty songs too.