That depends what kind of electric scooter. As long as you’re just talking about those little ones that you stand up on and only go 13 mph, there aren’t any laws.
If you’re talking about something more like a moped that goes over 20 mph, you need to have a driver’s license.
The law is you may not ride on and you and ask they will tell you may not ride with traffic meaning you may not.