Yes, you can have both plants and puppy living peacefully with each other :D
It's all a matter of behavioral training. You should make sure that the action of digging up the garden will be accompanied by an unpleasant context. By saying context I refer to a loud noise and sudden noise, or even turning on the lawn mower. A very common method is rolling a newspaper and hit with it on YOUR leg, in order to make noise. It means that you have to be present in the garden whenever your puppy digs in the garden. You'll have to be very consistent about it, and also not predictable by the puppy.
What ever you do, try not to yell at your puppy or physically hurt him, as it's not fair. Puppies tend to be insulted, which might cause a regression with controlling body wastes.