It has been observed in wild dogs and has a term applied to it... pica.
Some articles and opinions of veterinarians as well as those who raise dogs professionally will maintain that the eating of grass by dogs inherently helps them with various ailments... upset stomach, diarrhea (or conversely, constipation) and even anxiety.
Others, equally as sure of themselves, will say it's only because it tastes good... no one really knows for sure...