Off-color humor has been used in Ancient Greek comedy, primarily by its most famous contributor and representative, Aristophanes. His work parodied some of the great tragedians of his time, especially Euripedes, using sexual and excremental jokes which received great popularity among his contemporaries but would be considered embarrassing in the Christian milieu.
Dirty jokes were once considered subversive and underground, and rarely heard in public. Comedian Lenny Bruce was once tried, convicted, and jailed for obscenity after a stand up performance that included off-color humor in New York City in 1964. Comedian and actor Redd Foxx was well-known in nightclubs in the 1960s and 1970s for his raunchy stand-up act, but toned it down for the television shows Sanford and Son and The Redd Foxx Comedy Hour, stating in the first monologue of the latter show that the only similarity between the show and his nightclub act was that "I'm smoking"
American society has become increasingly tolerant of off-color humor since that time. Due in part to the mainstream success of comedians such as Dolemite, Andrew Dice Clay's "The Dice Man", and Richard Pryor in the 1970s and 1980s, such forms of humor came to be distributed widely, and grew socially acceptable.
In the 1990s and modern era, such comedians as George Carlin (and, in a more moderate form, Dave Chappelle) use shocking content to draw attention to their criticism of social issues - especially censorship and the socioeconomic divide. The highly-praised television show South Park also popularized the use of offensive humor. The Aristocrats is perhaps the most famous dirty joke in the US; certainly, it is one of the best-known and most oft-repeated among comedians themselves.
In India, sexual humor in particular is known as "non-veg" humor, contrasted with the "veg" jokes that are more acceptable in polite company. The use of the term "non-veg" is probably a reference to the carnal nature of sexual humor, and can be viewed in the context of the prevalence of both vegetarian and non-vegetarian dietary preferences in India.