Not every joke or comment is funny to everyone.
If the target of the joke or comment is offended the person making the joke or comment at the expense of another should be polite enough to apologize, remove the offensive statement, and make ammends. There are however boundaries that should not be crossed when trying to make a joke. Thick skin doesn't magically turn a truly offensive remark into something funny.
I myself got beat on a week ago Sunday for a comment I posted, I meant no offense by my remark, but offense was taken. I was contacted by the offended party, I understood how and why they took offense and I immediately removed the post, apologized, and will make ammends in person when our mutual schedules collide.
People make mistakes, errors in judgement happen, but how you handle those instances makes all the difference in the world.
Now if you find yourself constantly stepping in it, then a good long look at yourself is indicated to help you find out why you keep screwing up and figure out what you can do to correct it.