Oddly, I don't recall that happening with any of my many dogs. They have certainly tried humping each other and other people.
I suppose it is because it was obvious from the beginning that I was the boss, albeit very friendly one.
I do not correct my dogs for humping each other or other people, except for small children. Humans always correct the dog quickly and definitely, and that works better than my doing it. A spontaneous "Cut that out!" or "Get off me!" always does the trick. This the instinctive human reaction, and the dog understands it.
And as for other dogs, it's my opinion that they should settle it between themselves. Because they will anyway, when I'm not present.
One of the funniest instances was a toy poodle puppy humping the legs of my tall greyhound. The puppy went from leg to leg with great enthusiasm, while the tall dog just stood there. Finally the greyhound sneezed [laughed] and walked away. Of course he wouldn't have allowed an adult dog to do that.