While ripe tomatoes are generally safe for dogs in small amounts, tomato plants, including the leaves, stems, and unripe tomatoes, are mildly toxic to dogs.
These plants contain solanine and tomatine, which can cause gastrointestinal upset, vomiting, diarrhea, lethargy, and other issues in dogs.
If your dog has eaten any part of a tomato plant, especially the green parts, it's important to contact your vet as soon as possible.
To prevent your dog from getting sick, restrict access to tomato plants in your garden.