Jesters were certainly a historical phenomenon, although how much liberty they had on political matters is a matter of some dispute between historians.
On the other hand, there’s a lot of evidence for a similar phenomeon if you look at the Celtic phenomenon of bardic satire, which was believed to transcend mere verse to afflict its targets with disease and ill luck. And bardic poets were supposed to be inviolable.