Hello,
While this kind of behavior is not normal or expected behavior, we do sometimes see dogs that react that way. As long as she is managing to get food and water down and it stays down, it is OK to monitor her through the day. It may be irritation in her abdomen from the surgery, or more likely, irritation in her throat and upper airways form the endotracheal tube that was used during the procedure.
I would give your vet a call and let them know this is happening, and if it continues past today, I would definitely have her examined. If she starts to act painful, lethargic or starts vomiting, I wouldn't wait too long. If however her signs are just the gagging, it should start to improve through the day today.
I hope this is helpful and please let me know if you have any further questions.
Dog Veterinarian
Over 20 years experience treating dogs and cats