This hat or rather the dancing pallbearers that wear it gained fame after BBC news feature
According to Wikipedia the pallbearers who are from Ghana are locally referred to as the 'Nana Otafrija Pallbearing and Waiting Service.
The black hat is a typical foldable military field cap in its shape
I have no idea if this hat has an origin outside its fame as a hat worn by the dancing pallbearers, but I can only find it against cosplay adverts
This hat came to me via a friend who knows I collect hats and was enjoying the pallbearer memes on youtube.