In my opinion, it really depends who you're telling the joke to and how well you know them, this way you can judge how they'll react and whether or not they'll be offended by it. For example, using black comedy with a black women you just met on the street might not be such a good idea, but using black comedy with no harm intended with a black friend who you're close with and you two joke around like that all the time in a playful way can be fine.
With that in mind I don't think it's wrong for someone to be offended. There are definitely a lot of offensive jokes and people are affected differently by them. Even though it might just be a joke it's possible that people aren't aware it's joke and won't find it funny, which is essentially the goal of a joke; to be funny.
Like I mentioned before, everything depends on who you're joking with, so with one person there may be certain jokes that are off limits and with another person it's fine. So there aren't really any set rules about what or what not to joke about as long as it's all in good fun and no harm is intended, though it's important to keep in mind the limits specific to that person.
I feel like a lot of people can be touchy about their career and their morals, I'm not saying not to joke about it, but before you do make sure it's obvious that it's joke and that the person will find it funny and won't take it personally. I find topics like that is usually more making fun of a person and not so much a joke, even if it's meant to be funny. So again it really depends on how well you know the person and whether it actually is funny or whether it's rude.
Sometimes, like with careers and morals, jokes can definitely reflect what the joker thinks is the truth. Not so much with stuff such as simple as a kids knock knock jokes though. Because it can reflect the truth I think it's important to be careful when telling these kinds of jokes. Although they're not off limits for everyone, I would stay away from that just for that reason; it can reflect the truth, and even though a person may laugh, they may actually be offended by it.