Sorry but Dogsbane (Apocynum) will not keep dogs from your garden. It's name comes from its use to poison and kill wild dogs and I strongly advise you don't try that.
Something like Coleus (Solenostemon) is better it has an unpleasant odour that dogs dislike. Plant among other plants in your border and it should help. Not 100% as a determined dog will go were it wants and works better when in flower but if disturbed the oils in the plant exude the same unpleasant odour.