Yes a 10 year old boy or 10 year old girls should wear diapers if they need too or if they want to wear diapers.
Diapers are not just for babies or toddlers.
Anyone who wants to or needs to can wear diapers because they make and sell millions of adult diapers, baby diapers, toddler diapers etc.
A 10 year old should certainly be potty trained and able to use the toilet as long as they have no medical issue but if they want to wear diapers at 10 years old or any age they can and should.
My 7 year old brother is partially urinary incontinent and also wets the bed at night.
So my 7 year old brother wears Luvs size 6 diapers both day and night all the time because in the day he will sometimes wet his pants if he is not close to a toilet or forgets.
Sometimes he's so busy that he forgets to use the toilet or just does not want too and since he is wearing the diaper all the time anyway he might as well use it.
I also will wear adult diapers on road trips because it's better to pee in the diaper than wait for a toilet.