De gustibus non est disputandum applies. What is tasteless, like what is humorous (or not), varies with culture, fashion, sensitivities and the prevailing political climate. It is also a personal matter, so my answer is personal.
Like anyone, I have my own views on what is acceptable. This isn't a matter of being snobbish; it's that I want to hang onto my enthusiasm. In marketing, as in anything, working hard to produce stuff that is actively harmful (and spreading upset is harmful) is a fast route to burnout. On the other hand, I won't hold back on an effective and worthwhile message just because someone, somewhere might get hurt feelings.
As Emilie says, it's almost a certainty that someone will be offended by anything one puts out. (The mayor of a city I lived in used to talk about a "group" he called C.A.V.E. -- Citizens Against Virtually Everything -- who could be guaranteed to object to any project, regardless of how it would improve things.) But sometimes an ad has to be provocative to get a point across.
As to the calculation, it starts with enough research or knowledge to understand who might take offense, and why. That's balanced against the importance and the validity of the message. If there's a good chance that someone's going to be in a snit, is there a better way to design the message that will get the point across just as effectively? Am I just being lazy in going with the first idea that came along, whether mine or the client's?
If the answer to both of these is "No," I tend to apply the "Give me a break" test: Is this negative reaction actually sensible? The Dunkin' Donuts ad in Thailand is a great example: some people on the other side of the world, in a completely different culture, raised an objection to a highly successful (and perfectly tasteful, from a Thai point of view) ad. That's a forehead-smacking moment, right there. The inane reaction from some quarters to Coca-Cola's Super Bowl 2014 diversity ad is another.
I've my own experiences along this line: in one case, the key image in a billboard design, which perfectly communicated the intended message when we surveyed it, was rejected by a client's Board (a non-profit in the Black community) because "the Black kid is too light-skinned." The client's marketing director and I both reacted with "Give me a break!"
As for future employers, if the HR people are self-appointed guardians of Political Correctness or they have other hot-issue buttons, you may find you stomped on them. In the end, though, it is yourself that you have to live with. Trying to please all the people, all the time winds up in a bland, inconsequential place of no value to anyone.
Ultimately, it comes down to your own judgment and integrity. You can't expect to get it right 100% of the time, but you can certainly try.