We don't recommend using mothballs to keep dogs out of your yard. For starters, they're hit or miss in their effectiveness as a dog-repellent. And sometimes, dogs end up eating the mothballs, which contain toxic pesticides that can cause serious illness or even death when ingested.