For one thing, prevention of diarrhea in a dog comes down to micromanaging your dogs intake. All in all, avoid sudden changes to a dogs diet, feeding him table scraps, milk treats, or leaving the trash can accessible. Most importantly, keep your dog on top of his vaccinations.