I so agree with Dave, that "nothing beats a good fence." Although many dogs can (pretty easily) go over a 5 or 6-foot fence, usually that is to get out of an area that they are confined in, not to get into an area; a 4-foot, or maybe even lower, fence will likely deter them from going into your yard, unless there is something there that is extremely attractive to them (like maybe if a male dog wants to get to a female that is in heat)
I have a 2-1/2 foot fence around my veg garden that my 2 big collies (think "Lassie") totally respect, and one of those cheapo flimsy "border fence" things (about a foot tall) around my perennial flower bed, which also keeps them from running through that...