Most high school dormitories and university dormitories are like this. All boys wear only a pair of underwear in the dormitory, and only a few don't wear them. Boys will do this, so roommates generally don't resent it. Even if they are disgusted, it is their problem, because they don't understand.
Therefore, of course, boys can wear a pair of underwear in the dormitory, and many men do the same at home. Not only when sleeping, but also during the day.