Generally, no. New York City’s public indecency/lewdness laws (Penal Law §245.00, Admin Code) prohibit appearing in public with private parts exposed. Underwear alone typically does not meet the legal standard for “covered.”
Outside these contexts, walking in underwear risks a summons or arrest. Wear street-legal clothing in public spaces.