I have the hat which has a snap on/at the back of the hat.
Which preposition to use here?
This is the sort of thing the sentence refers to:
The prepositions 'at' and 'on' can both serve as 'prepositions of place' and the choice depends on whether you are trying to describe where on the hat (directionally) the snap is, in which case 'at' would be the appropriate word, or the surface on which the snap resides (in which case 'on' would be more appropriate).
If you're primary concern here is how to refer to these hats, they are often referred to as "snapback" hats or "snapbacks", and are marketed as such (e.g. the NBA has a whole line of 'Snapback Hats')