It's worth noting that "the law" in Ankh-Morpork was, until arrival of Captain (then trainee) Carrot in 'Guards! Guards!' largely based on private prosecutions, thief-taking (thief with a small 't') and the rump City Watch consisting of around half a dozen night-watchmen concerned with preventing drunken disorder and a few dozen day-watch who were mostly concerned with traffic movements.
Even taking that into account, Vimes repeatedly reflects on the fact that the wizards inside Unseen University are effectively a law unto themselves, or at the very least clean up their own messes.
Despite his deep distrust of magic, he quite liked the wizards. They didn’t cause trouble. At least, they didn’t cause his kind of trouble. True, occasionally they fractured the time/space continuum or took the canoe of reality too close to the white waters of chaos, but they never broke the actual law.
Men at Arms
and
He quite liked the wizards. They didn’t commit crimes. Not Vimes’s
type of crimes, anyway. The occult wasn’t Vimes’s beat. The wizards
might well mess up the very fabric of time and space but they didn’t
lead to paperwork, and that was fine by Vimes.
Jingo