A few thoughts:
- Cruelty is out, especially if directed at a specific person.
- Anything racial is out.
- Ethnic or religious humor is another land mine. [A good test is whether the comment or joke could be told in front of an audience of that ethnic group without causing cold sweats or a protest march.]
- Sexual joking is unprofessional, particularly if it is crude.
That said, most of us have uttered something we later - seconds later in some cases - realize was inappropriate or just flat-out dumb. If your workplace has a climate of trust and we aren't repeat offenders, people should be willing to cut us some slack.
It will be a sad day when humor is banned from the workplace and there are times when the "gotcha" is worse than the initial offense.