Yes, but it's uncommon. Usually, a canker sore forms from a tear in the dermis (membrane) on the lower or upper inside lip. There's no mucal dermis on the gums, so it's pretty rare to get it on the gum tissue itself.
That being said, there are a few other culprits that may play into this. If you eat a concentrated amount of citrus fruits, lay back. The citric acid raeps enamel, and soft mucous membranes on the inner lip dermis are no different. If you smoke, stop! I kept getting canker sores, and when I went to my doctor, lo and behold, the cause was there. Same goes for alcohol and sugary drinks. Ditto for spicy shit like Frank's or anything Indian.
So now, you should get treatment. Wash your mouth out with Hydrogen Peroxide. Don't gargle, just swish it around and spit. Stay the hell away from mouthwash. Many mouthwashes contain alcohol, and can aggravate the sore. And DON'T use magic mouthwash. That stuff don't work, and a lot of the shit in it is dangerous to ingest.
Well, hope this helps...