Allantoin is a small, simple molecule. It occurs naturally in comfrey root, in many plants, and in the bodies of most mammals. What it is sold for is two mild effects.
The first is keratolytic — it loosens the bonds holding together the flat, dead cells on the skin surface, so they shed more readily. That is why rough, flaky or thickened skin feels smoother after a few days. It is a much gentler version of what urea or salicylic acid do, and it does not sting.
The second is soothing. Allantoin reduces the feeling of irritation on inflamed or freshly damaged skin, and it is included in after-sun gels, wound balms and post-procedure creams for that reason. The mechanism is not well pinned down, and the human evidence is thin — most of the claims about it promoting healing come from laboratory work and from its long history in wound products rather than from good clinical trials. What is not in doubt is that it is well tolerated and that people find it comfortable.
In the US it is recognized as a skin protectant ingredient at up to 2%, which is the regulatory basis for the claims you see on tubes.
Allantoin is one of the very few skincare ingredients with essentially no side effect profile worth writing about.
There is no group that needs to avoid allantoin.
It is safe on children and on infant skin, safe in pregnancy and breastfeeding, safe on broken and post-procedure skin, and safe on the face, eyelids and lips. Allergic reactions to it are very rare.
The only sensible cautions are about what it is packaged with rather than the ingredient itself. If you have sensitive skin or a history of contact allergy, read the whole label — fragrance, essential oils and botanical extracts in a "soothing" cream cause far more trouble than allantoin ever will.
If you have reacted to a comfrey-based product, it is more likely the plant extract than the allantoin. Purified allantoin is the cleaner option.
And the honest gate here is not safety but expectation: do not choose a product for its allantoin content and do not pay extra for it.