From a dog's point of view, your backyard is a smorgasbord. Every dog I've known has enjoyed finding new edible foodlike substances. To make your garden safe for your dog to explore, you can eliminate the most obvious dangers.
In the long run, it's more effective to fence off selected areas of the garden than to cage the dog. Bear in mind that dogs are pack animals who want to be wherever their people are, not isolated in a far corner or left alone for too long.
Most dog owners know chocolate is toxic to dogs, but they may not realize they need to avoid using cocoa mulch. Grapes (and raisins) are also toxic to dogs, so keep dogs out of the vineyard. Emergency vets point to snail bait (metaldehyde) and rat bait, as well as antifreeze, as the most dangerous household poisons for dogs. Snail bait based on iron phosphate, such as Sluggo, is nontoxic to dogs and birds.
Another hazard is fertilizers, whether in open bags or freshly added to the garden. Dogs are irresistibly attracted to the odor of manures and organic amendments, but they can get diarrhea or worse when they eat some. In my experience, it doesn't help to bury the organics a few inches deep or mix them with soil. Alfalfa meal is a dog's idea of a special treat. With access to the garden within a day or so after amendments have been added, I've known a dog who feasted on the whole shebang, including mulch, lava rock, and any chemicals that were used (the proof came out over the next couple days).
If you can't keep your dog out of the garden for a couple days, use compost tea as a liquid fertilizer. Once it's added to soil, its odor is less likely to attract dogs. You can find recipes for either fermented or aerated compost teas.
Dogs lick and taste everything, so if you use any pesticides, your dog will get a dose. Eliminating all pesticides will make your garden bird-friendly as well as dog-friendly. You need a variety of insects to attract birds. Putting birds in charge of controlling insects saves you money, improves your soundscape, is more sustainable, and adds entertainment value.
The long list of poisonous plants includes oleander (don't use the twigs as chew toys) and lily bulbs (for dogs who like to dig). If you're putting in a new landscape or have a new puppy, consult a handbook of poisonous plants to figure out which ones are worth the (usually minor) risk. But remember that pesticides are a far greater hazard and toxic at smaller dosages.
My idea of a dog-friendly garden doesn't include agaves with needle-sharp leaves or grasses with sharp awns that can be inhaled or embedded between toes (weedy foxtails are the biggest offenders; native needlegrasses may pose a small risk). But dogs can peacefully coexist with prickly bird-sheltering plants such as barberries or gooseberries, and even thorny roses, in a well-designed garden.
The key to having a nice garden and a happy dog is training. Just as you have to teach your dog how to behave indoors, you have to establish the ground rules outdoors. Some dogs catch on right away; others need consistent reminders.
A dog-friendly garden has play space, access to drinking water, a designated "bathroom" area, and rules about where the dog is allowed. Play space can be a small area for tug of war, a big meadow for retrieving a frisbee or ball, or running paths that include dog-sculpted tunnels in the shrubbery. To make cleanup easier, train your dog to use an unplanted mulched area for elimination. You can even buy or build a system for composting pet waste.
Each dog is different. Observe your dog to discover her favorite sun/shade napping places, if she likes to dig or likes water, if she likes to run the fence lines or sit by the gate to watch the world go by, or has a favorite squirrel-watching post. Provide more of what the dog likes so that when unsupervised, the dog will respect your garden.
If your dog's idea of a good time is digging, you can provide a sand pit and bury dog toys in it, instead of patching up your garden beds. I've discouraged infrequent diggers by covering the soil with mulch.
If your dog overindulges in fallen apples or picks tomatoes on his own, you may need to keep up with harvesting or fence off the edibles.
Tanya Kucak has lived with doberman pinschers, a cockerpoo, a golden retriever, a saluki, a beagle, and a rat terrier (not all at the same time!).