If I Google “table dancing” (in a fresh new browser I just installed on incognito mode with a VPN and everything + I never watch porn or search this stuff or anything, so it’s not just customizing it to be sexual for me - I encourage you to try this yourself) the first result in the Wikipedia article about it, which reads:
A table dance, or bartop dance, is a dance performed at (or on) a table or bar, as opposed to on a stage. It may be an erotic dance performed by a sex worker or it may be done as a leisure activity.
As you keep scrolling down, the next thing it shows is images of erotic dancers table dancing, the next thing is a list of nearby strip clubs, the next result is the dictionary.com entry for table dancing which reads:
a form of entertainment in which naked or scantily dressed women dance erotically at the tables of individual members of the audience, who must remain seated
The next result is videos of erotic dancers table dancing. And so on, and so on.
So, yeah, there’s definitely, without a doubt, a strong sexual/erotic connotation/connection to the term and the joke they made.
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.