To answer this fully there's a few categories I feel the need to cover.
Location
I think in a public forum all bars should be (effectively) off. You're entering the open marketplace of ideas, express whatever views and opinions you wish. Just don't be surprised then if people suddenly turn around and call you out on them. If it's private? Try your best to respect the individual(s) sensitivities, but if this is resulting in you not be able to really be yourself you should probably look at limiting the time spent around such individuals. However this all assuming that...
You Separate General Opinion to Specific Opinions
In other words, talk about how much you don't like Donald Trump, Religion, Feminism etc. all you like. But don't be a generalizing ass hole who treats others badly just for being associated to or liking X (something I've seen a lot of people here do to Donald Trump supporters btw). You're free to disagree with that part of them, but the second you are attacking people for a difference of opinions is when you lose credibility.
Is it Serious, or in jest?
Exception to something being aimed at an individual (sometimes) is humour. If you and the other person appreciate offensive humour then go at it. If the other doesn't, then I like I said above try to respect their boundaries, but you probably should also consider finding people you can relate to better.
Don't concern yourself with people offended on behalf of X
This is something I occasionally run into with offensive humour with friends. The friend is completely fine with it, but other people then start to get offended and/or defensive on their behalf. This is honestly unavoidable, if the recipient is ok with it but the observer is offended any ways then they are looking to get offended, there's not much point in trying to respect or appease it. That being said, I've been this person before too, so I wouldn't suggest simply going "Fuck off, get a spine!". Still be respectful, try to explain how it's a joke both you and the recipient are ok with. Cause maybe you caught them on a bad day, they read too deep into something or they're just being protective of someone they care about.