E-scooters and e-bikes usually sit in a different legal category from ordinary bicycles, and that is where people get caught out. Many countries that do not require helmets for regular cycling do require them for e-scooters or for faster e-bikes, and some set minimum ages, speed caps, or ban shared scooters from footpaths entirely. A few cities have banned rental scooter fleets outright, so the app simply will not work there.
When you unlock a scooter through a sharing app, the app itself usually displays the local helmet rule and age requirement during sign-up, and that is a reasonable first indicator, though not a substitute for the actual law. Fines for riding without a required helmet, riding on sidewalks, or carrying a passenger are common and often issued on the spot.
The safest assumption is that faster or throttle-powered vehicles attract stricter rules. Check the local transport authority page for the city you are in, since rules change frequently and can differ between neighboring cities in the same country.