I always thought it derived from the Dogs tendency to lick and areas that might be "salty"? Well it made sense to me all these years from hearing the Flatt and Scruggs version on record in my youth and assuming it was sexual but not shagging. BTW it made us Brits LOAO when a dance craze called "the Shag" started in the US.