It's not really clear why dogs (and some cats) like to eat green grass. Many people believe it's because it helps them "settle" their stomach or for other such reasons. Personally, my observation is they just like the taste of it. If a dog does throw up after eating the grass, in my experience it's because the grass stuck in the back of their throat and gagged them... I sure their are differing opinions though...
I have observed them eating only certain types of grass. Some will throw it up and others won't, I guess it depends on how upset their tummy is, IMHO it may be a byproduct of domestication, they use to eat herbivores, when they ate them they got grasses and such, because this is what their prey ate.
They eat the rough flat couch grass, and maybe the roughness causes some of them to vomit as it rubs against their throat. Mine will eat it if they find a nice patch, and even take it from me if I pick it from them.
You can buy it in pots to grow if you have an indoor cat.