All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
In principle, it is permissible to wear any type of clothing unless there is evidence indicating they are prohibited.
This reflects the good merits of Islam and its easiness, and its renunciation of difficulty and hardship.
With regard to the hats you mentioned in the question, we are not aware of any evidence that would make it Islamically forbidden. However, if you are asking about whether or not it is an imitation of the non-Muslims, then the imitation that is prohibited is when it is in relation to something that is peculiar to the non-Muslims, or which is one of their slogans. On the other hand, things that have become common among the Muslims and which are not peculiar to the non-Muslims do not take the ruling of the forbidden imitation.
Allah knows best.