One common assumption is that dogs eat grass to relieve upset stomachs.
Since studies show that less than 25% of dogs vomit after eating grass, it's unlikely that they turn to the green stuff as a form of self-medication.
In fact, only 10% of dogs show signs of illness prior to eating grass.