It's really not that hard to keep your forms of merriment clean and appropriate, if you are a generally good-natured person that likes who you work with and wants to make them laugh.
That said, there are certainly people that can only perform humor as a zero-sum game. But in my experience they are also generally the kind of people that subject their coworkers to uncomfortable conversations in a myriad of other ways.