I remember slipping once. I made a joke a work. I can't remember the details of the joke but it had to do with dogs and bitches running around in the office. Though I know (and knew then too) that 'bitch' can be used as a derogatory term to mean woman, within the context of the joke, that just hadn't crossed my mind at the time. Only after I said it and a woman called me out on it did it click in that she'd understood it quite differently.
I was very lucky though in that she gave me a chance to explain myself. The fact that another woman who knew me better and understood the joke came to my defense probably helped too. I think the context of the joke and my reaction to being called out helped too. I did immediately apologize as soon as I realized the other possible way of interpreting the joke.
English, rich in homonyms, is full of such traps for the inattentive, and you need to be inattentive for only a few seconds to fall into it.
On another occasion, I showed a friend one of Kipling's more racist poems intending to mock the beliefs of his time. I'm not sure if he understood my point though or if he thought I was condoning the content of the poem.
I think it's only fair to give a person the chance to explain his intent before crucifying him.