No it should not be swallowed, encourage your kid to not swallow it.
Next Steps
(-) Provide some pictures of ulcer
(-) Provide some detailed history like is their any history of trama, any teeth biting habbit etc.
(-) Visit a dental clinic or video consult
(-) Maintaine good oral hygiene
(-) Brush twice a day
Health Tips
If it does not goes away within few days then you need to visit some doctor.