It is recommended to use warm water and salt to gargle if you have a mouth problem, since the baking soda won't be effective. Salt has components that will help in killing germs in the mouth and heal any infection.
Baking soda is generally perfectly safe - it buffers the mouth to pH 7, which is neutral. It doesn't do much in the way of healing. Those table salt suggestions are valid and worth trying. The salt that REALLY addresses mouth lesions is ALUM (potassium aluminium sulphate crystals) and these are very effective in a little warm water. Use a generous "pinch" of alum crystals, rinse out the mouth and spit the liquid out. See your Pharmacist for supplies. The other thing that is brilliant for mouth infections is a tea made by steeping chopped up Marigold flowers (Calendula officinalis) one third cup of chopped flowers, two-thirds boiling water. Cool and rinse the mouth out as often as desired. It will keep about a week in the 'fridge and then needs replacing. 100% safe and 100% effective