Well… not all dogs are countersurfers, or tablesurfers.
Big dogs need lots of training every day when young or they all to soon become hard to live with [us humans, in a building].
Our rescue dog (80ish pounds) surprised us when we found out he was quite the incorrigible countersurfer. We had to put up a gate across the kitchen doorway. No amount of training him out of it would resolve this issue.
Stopping a cat from countersurfing, or counterclimbing, is just a matter of putting out a roll of aluminum foil or packing tape: