It might be due to other reasons like- Immune disorder, drug induced, infection (viral, bacterial, fungal, blood related problem,dermatological disorders, allergic, etc.
Next Steps
consult dentist or general physician, with your medical history (ulcers and other medical problems if any). some test may be required for exact diagnosis.