Hello,
From the symptoms it sounds like a canker sore. They are generally caused by Stress, tissue injury, eating certain foods – including citrus or acidic fruits and vegetables or underlying health condition, such as an impaired immune system; nutritional problems, such as vitamin B-12, zinc, folic acid, or iron deficiency; and gastrointestinal tract disease, such as Celiac disease and Crohn's disease.
Pain from a canker sore generally lessens in a few days and the sores usually heal without treatment in about a week or two. Avoid spicy or acidic foods during this time. You can use topical ointments like numbing ointments, such as benzocaine (Oragel), anti-inflammatory (steroid) gels,benadryl allergy liquid mouthwash, oral preparations of steroids and vitamin supplements.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your dermatologist. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.
I had one of those once and it hurt like heck. It was just an infected sore, which slowly healed up. I don't think they are really like pimples, because they aren't stable and can't just sit there until popped. The mouth tissue will heal it either way. But that is just my guess!