J.F.
At 2 she's still experimenting, and stimulating the gag reflex that can happen by accident and then kids try it over and over, especially when they see they get a reaction out of you. Here is my suggestion (based on my own experience and experience with kids friends), be VERY no nonsense about it. If she gags herself, she loses her food and absolutely does not get anything else. Gagging can quickly escalate to induced vomiting and is a common means of control that kids use on their parents, by vomiting in order to get out of eating what you put in front of them, and to make you give them something they want. It can be a way to get what they want, but also is a way of making you jump through hoops for them, whether they understand what they're doing or not, and it sets an incredibly bad precedent. Nip it in the bud now. Kids will go to extremes to see what they can get away with, and it's easier to avert this kind of behavior by putting your foot down at the beginning of any potential issue.
Of course, this may seem extreme to you, and it is entirely possible that your daughter may just be playing you may never have a problem, but I've seen it happen...MANY times where kids push it to the limit because it wasn't dealt with effectively in the beginning. It doesn't have to be a big deal, just put your foot down now and let her know that it's no acceptable.
Best of luck!