There are several things you need to think about when setting out to create a pet-friendly garden.
Plant densely - and cleverly!
If you plant landscaped areas densely, dogs will stay out. Think about planting in raised beds or on mounds, and start with large plants. Put up temporary fencing around new plants and when you remove it think about adding a rocky border or low fencing as a reminder to stay out.
Plant sturdy shrubs and perennials like ornamental grasses around the edge of the garden. Put brittle plants like salvias behind them, where they'll be protected.
Check plants are safe
The Dogs Trust has a list of plants which are toxic - and you can find a cat version online as well.
Many wild mushrooms can kill pets - if they appear in your garden dig them up and dispose of them straight away. The compost pile should be off-limits for the same reason. Weeds can be dangerous, especially foxtail grasses with barbed seed heads, which dogs can accidentally inhale with serious consequences. Make sure you don't have any sharp leaved or spiny plants that could damage your pets eyes.
Plants as medicine
Some plants can have a medicinal effect on your pets. Burdock and Milk Thistle can aid digestion - treat them as useful weeds, you'll need to prune them to keep them from taking over but your pet will appreciate it.
Training your pet to be garden friendly
Now that you have a garden that is kind to your pet, the last thing you want is having it torn up by your ungrateful beast! Dogs can be trained by spending time with you as you garden - move them away from borders as you weed and plant, making sure they stay on the grass and praising them for doing so. If your dog is an unrepentant digger, let him have a section of soil that is his alone, and bury tasty treats there for him - hopefully that will prevent him turning his attentions to your prized petunias! Similarly, you can train your dog to only use one bit of garden as his toilet area, or indeed, not use the garden at all by taking him elsewhere on his lead regularly.