Is it safe to use hydrogen peroxide

I have this one tooth on the back of my mouth that is bothering me everytime i chew food.My gums in that tooth is slightly swolen but i cant even tell.It feels lik everytime i bute down on food the food goes in my gums.So weird.It hurts alot.I know i should see a dentist but i want to try hydrogen peroxide.My dentist told me if my gums hurt or it gets swollen i should try the hydrogen solution.Im 24 weeks pregnant and i wanted to know if its safe to use during pregnancy.