A 2 year old boy can wear just a diaper in public.
As long as it's hot out or warm enough out then the 2 year old can wear just a diaper or just a diaper and shirt in public.
Nobody will say anything or thing anything wrong about a 2 year old wearing a diaper and it certainly won't be embarrassing for the 2 year old boy to go out in public wearing just a diaper.
The 2 year old boy is used to wearing diapers and will also think nothing of it.
If the 2 year old boy is not potty trained and wearing diapers which is normal then they will be more comfortable in hot weather or warm weather wearing just a diaper or just a diaper and shirt.
In stores though the 2 year old must have a shirt and shoes on but other public places they can be in just their diaper.
My kids wore just diapers in public when they were 2 years old and even 3 years old and when newborns and babies when it was warm and hot outside.
You might get a few weird looks from some entitled people but don't worry about them as most people don't care if you take a baby or toddler and 2 or even 3 year old out wearing just a diaper.