It really depends how an author makes the perverts funny.
For example, there are perverts like Kondo and Sarutobi in Gintama who are huge stalkers and perverts and thus perform gags in which I mostly roflmao'ed. Look at this scene:
This gag itself has so much context how the pervert behaves, it's also amazing how Sorachi comes up with these funny gags lmao.
Edit: This gag is also funny as hell, from the monk (Binbougami Ga):
In conclusion, as long as their perversion is not utterly cringe or very annoying, perverted characters can be quite funny. It is a matter of successful gags. I do think Sanji's simping would be much more bearable if Oda wouldn't use the same lame ass gags over and over and over and over again.
[automerge]1610365530[/automerge]
Seriously, Kondo is one of the most funniest perverted anime characters ever: