Yes swallowing gum can cause stomach pain in some people.
Not everyone who swallows gum will experience stomach pain but for some people the gum can get into the digestive tract and then lead to an intestinal blockage.
That intestinal blockage can cause stomach pain and even constipation.
Swallowing gum is not harmful really but it's still not a good idea to swallow gum and instead you should remove the gum from your mouth and throw it out when you're done chewing the gum.
I've swallowed gum before and I was told as a kid that the gum would never get out of my stomach but that's not true.
Eventually the gum will leave your stomach and come out in your poop.
The gum will usually come out of your stomach and into your poop within a day or so.