In an interview in Playlist, Ray Cooney (who has written many hit comedy plays) recently revealed what he considers the key to great comedy plots:
"The plot in a good farce should be able to be transplanted into a stark tragedy. Most tragedies have as their theme the struggle of the individual against forces that are overwhelming and the individual's efforts to combat those forces as the tide runs stronger against him. Also, the individual is usually tortured because of his own character flaws and his inability to control those flaws under stress. Well, that sums up most of my farces."
My old writing mentor, Danny Simon, also thought this was the essence of great comedy: make it real. No matter how ridiculous things get, keep a link to the believable. Be sure that it is the audience that finds the events funny, never your characters.
You can prove the truth of this by considering "Hamlet." It's a great drama, and it would also make a great (early) Woody Allen comedy.
When I was story editing comedy scripts, I always found that the way to make a script funnier was to make it more real. Not more conventional, but more in tune with the characters and the situation that has been established. That surprised a lot of newer writers, who thought the way to a funnier script was more punchlines (and watching some comedies on TV, it's clear there are plenty who didn't get the memo).
(If you want to write sitcoms, get a copy of my book, "Successful Sitcom Writing," published by St. Martin's Press--it's out of print now, but there are used copies on Amazon. The examples may be older, but the principles haven't changed.)