I think the problem is in referencing a specific phrase, "table dancing" and not just the idea of "dancing on a table" which is more common and wouldn't be in the dictionary as a term.
If someone says anything about dancing on a table or bar, the first thing I think of is PeeWee Herman dancing to Tequila by the Champs, perhaps betraying my age a bit, followed by the music video for Hypnodance by Little Big. Other than that, it's just a random smattering of movies and TV shows (and a drunk wedding attendee or two) hopping on a table, shouting something to the effect of, "Let's party!" and then dancing very poorly.
Sure, erotic/sexual versions exist (like everything, as dictated by rule 34, of course), but that's not likely the norm that most people encounter.
It's perfectly reasonable to make a dancing joke when on a table that has nothing to do with being sexual or erotic.
There seems to be a legitimate basis for the racism angle, intentional or not. This random article is one of many that delve into it.