The gag reflex is an inbuilt tool to help us not choke by ensuring nothing too large goes down our gullets without us having swallowed it. The gag reflex can be suppressed, for example some circus acts such as sword swallowing requires it to be non-existent.
Many people have problems with an oversensitive gag reflex. This is something that your dentist ought to be familiar with and they will be able to offer you tips on how to suppress this.
Some ideas are:
Unfortunately a sensitive gag reflex is quite common, and can be made worse by your dentist if they aren’t careful and sensitive to the situation. To help them it is best to make them aware of your problem before you see them and to let them know which procedures have caused you problems with gagging in the past.