Yes it's okay for 10 year old kids to wear diapers if they need to wear them or if they want to wear the diapers.
Some kids at 10 years old and above wet the bed or have incontinence issues and wet their pants so having a diaper on is much better for the kid.
The diaper contains the urine so that the kid doesn't get wet pants as long as the diaper is changed often enough so that the diaper doesn't leak.
There are plenty of 10 year olds and older kids who wear diapers during the day and during the night and there's nothing wrong with it.
I hear of people saying that once a kid is potty trained it's not good for the kid to wear diapers but I don't see the issue with it.
The diaper is just a different type of underwear and actually more convenient as with diapers you can pee in them and if you happen to need to poop and cannot get to a toilet the diaper will contain the poop until you can clean up.
With regular underwear or boxes you get a stain on your pants and have poop or pee running down your legs.
So yes it's okay for a 10 year old kid to wear diapers if they want too or need to and it's okay for anyone of any age to wear diapers.