I would say that there's a large degree of truth in what rekstout says, but I wouldn't completely agree that humour is completely governed by consensus. And, it must be noted that people have different milage for what they think is funny. Personally, I find the Bernard Manning/ Jim Davidson style of 'humour' to be lazy, crass and offensive, but I'm also aware that some people manage to find them hillarious. It's also partly because I've run a comedy club that many gags/ acts strike me as being a lazy retread/ direct plagurism of someone else, even when the audience has been wetting itself - indeed, as a club owner, you have to walk a line between only getting acts you think are innovative or original and getting ones that will guarantee laughs, but these things are subject to change too. One example, Eddie Izzard and Reeves and Mortimer both spent years being ignored by crowds or getting boo'ed off before crowds started to twig what they were trying to do with their comedy.
-
However, in general terms, there are some basic rules of comedy. Actually, there's just one - subvert what the audience expects. Nearly all comedy works by some variation of this rule - even comedy you or I might despise.