No, you should avoid wearing a hat immediately after a perm.
Similar to washing your hair, it is recommended that you avoid wearing a hat for at least 48 hours after perming. This precaution is important to prevent flattening or distorting your newly set curl pattern.
Allowing your perm to properly set without external pressure from a hat helps ensure the curls maintain their shape and definition as intended.