If you live in a first world country you can just get the a vasectomy or a hysterectomy (you can't tie the tubes with dogs, the uterus becomes diseased if they don't have pups once every couple years)
Done correctly your dog could still fuck. But, the best way to do this is to fuck them yourself. There are lots of diseases dogs can only catch from each other and none they can catch from humans. Male dogs also gladly practice rape and sexual violence, and females often fight them back, so it's dangerous in more way than one. Just give him a blowie and remember to keep the knot moist by cupping it in your hand.