Hello, I sent your question to our vets and this was their response:
Thank you for contacting Doctors Foster and Smith.
The only way to prevent your male dog from mating with your friend’s female dog who is in heat is physical separation. Both dogs need to be kept under close supervision, walked outside on a leash (even if you have a fenced yard, as dogs will jump or climb fences to mate with a female in heat), and kept in separate rooms (with the doors closed!) if they are in the same house.
There are no grooming aids or other products that will effectively deter your male dog. Keeping the dogs physically separated is the only way to ensure an unwanted pregnancy does not occur, unless the dogs are spayed or neutered.
We hope you find this information helpful. Thanks again for contacting us.
Drs. Foster & Smith