Your dog noses into a planter and swallows a mouthful of soil. The problem is not only the soil itself. Potting mix or garden beds may contain fertilizer, pest-control products, compost, toxic plants, or sharp debris. If you know or suspect they swallowed a chemical, plant, or foreign material, contact your veterinarian or an animal poison service promptly with the product name and estimated amount. Do not induce vomiting unless a professional tells you to.
Repeated soil eating deserves a veterinary discussion, especially if your dog also vomits, has diarrhea, loses weight, or seems unwell. Keep packaging from any garden product and take photos of the area so the clinician can judge exposure. If your dog is retching, has abdominal pain, or cannot pass stool, seek urgent veterinary care.
Prevent access while you learn why
Fence off the bed, move pots out of reach, or supervise on a secure lead. Avoid leaving a dog alone with soil you cannot identify. Offer safe activities such as a supervised sniffing game or an appropriate chew away from the garden. Teach "leave it" with harmless practice objects indoors and reward turning toward you, then work gradually outside. Do not set up repeated tests with real potting mix.
Your dog might be exploring, seeking something to chew, or responding to a health issue. You do not need to settle that question before making the garden safer. The first job is to stop further exposure and share the pattern with your veterinarian.
Sources: Dogs Trust: Items in the home and garden that are poisonous to dogs. Cornell University College of Veterinary Medicine: Gastrointestinal foreign body obstruction in dogs.