I don't think this is true- every dog I've had eats grass frequently and it doesn't usually cause them to throw up. Also- dogs can throw up on demand at any time, they don't need anything like grass to help them. This is because it is the natural way that female dogs bring home food for puppies, they vomit up the food to share it with them.
I'm pretty sure dogs sometimes vomit on purpose with the explicit goal of sharing food with humans, and/or just to eat it again for fun out of boredom. When my dog is bored he will often start preparing to vomit, and if I tell him 'no', he will stop.