Hi dentist here. I'd recommend seeing your dentist rather than your doctor in the first instance. We are highly trained at spotting ulceration a that might be precursors to, or indeed, may be mouth cancer. We can refer to oral medicine,or even an allergy clinic if required.
The main causes are- viral ( could be any virus, but herpes/hand, foot and mouth etc can cause lesions)
It could be trauma related- a burn from a hot cheesy pasta or eating some hard crusty bread are common causes, as is cheek biting or getting a hard knock.
Lack of vitamin B can be a cause, so supplements can be helpful, you might want to get blood tests to check. Other causes include autoimmune diseases, allergies to certain foodstuffs etc. Dry mouths can cause ulcers as soft tissues tend to be more fragile.
However there are some people that are just prone to them, and there is no obvious underlying cause.
It can be hereditary.
Some of the over the counter preparations are quite good for taking the sting away, such as difflam mouthwash, gengigel or anbesol. I don't really rate bongela.
Corsodyl mouthwash tends to work for some, as does a salt mouth rinse.
However, generally I find that the only thing that really speeds up recovery are steroid based preparations. You can get hydrocortisone lozenges that you suck that help, however it is notoriously difficult to keep the lozenge bear the sore bit.
You can get soluble Steroid preparations that you can make into a mouthwash and use it to rinse around your mouth- betamethasone is the one that springs to mind. This is prescription only and your dentist or doctor can provide.
For me, the best treatment there ever was, was a preparation called adcortyl in orabase. This was amazing. It usually killed the ulcer overnight. It had been discontinued (due to funding?) about 11 years ago, and I'm gutted. You can still get it in the Southern Hemisphere- Australia, Hong Kong, Thailand to name a few places. Theoretically you could order and ship them over, but then a 5g tube would cost £23!!!!
One trick I've seen some do is mix up a steroid lozenge in orabase paste, ( the plain paste is still available in U.K.) and maa as me their own version. The paste is great for covering and protecting the ulcers area.
Another thing to get your dentist to check is if you are grinding or cheek biting and this is causing trauma. If that's the case, sometimes a simple mouthguard/night guard can help.
Certain foods and products can exasperate ulcers, some examples are cinnamon, sodium laureth sulphate, which is commonly found in toothpastes, and a preservative called sodium bisulphite, which is hard to avoid as it's in most processed foodstuffs.
Alcohol doesn't help, and artificial sweeteners and benzoic acid in fizzy drinks are common culprits too.
They are really nasty, and actually a bad bout hugely affects your quality of life.
There are other more hard core treatments, but they would be left to the oral medicine consultants to organise.
I hope this post has helped!