Although burning the flag or wearing it as underwear is legal, it is considered by most Americans to be unpatriotic and shows contempt for the country and its people.
Which is what the demonstrators who do such things are trying to show.
As for wearing it as a hijab: https://www.theguardian.com/us-news/2017/jan/23/womens-march-poster-munira-ahmed-shepard-fairey-interview
Pro and con articles. It’s obviously a religious/ideological symbol…signifying women’s submission.