It is true. In dog and wolf pack psychology, only the most dominant female and male are allowed to mate. If a dog humps another dog, or person they are attempting to show the dog, or person that they are more dominant and alpha over them.
When it happens, disrupt it with a very loud noise. If the dog is reluctant to stop, physically separate them and push the dominating dog to the ground. Place them on their side, feet away from you and place a hand on their chest, and one on their cheek/side of face and keep them there untill they relax and submit. By doing this you are showing them that they do NOT have breeding rights and that you, the rightful one, is alpha over them.
Be careful not to accidentally encourage this behavior with extra attention. It can quickly turn into negative reinforcement. Any attention is better than no attention in a dogs eyes.
It may sound odd, but when we first got Sadie she would often try to hump my significant other while he would be laying on the couch, or bed. She had major alpha issues. It took three times of making her submit before the behavior ended. If she pulls her ears very high and straight up when around another dog I keep a VERY watchful eye on her. The moment she T's off to another dog (Placing a paw on the back or shoulders of another dog) I verbally correct her and make a very loud clap to distract her. By doing this I'm showing her that I am the pack leader and she does not have the right to dominate others.