Remember my "Joy Boy was an Ancient Oni" theory? We have Ace make straw hats for Oars Jr, and Tama was the one to teach him to make the straw hats.
I think the Straw Hat in Mary Geoise was woven by Ryuma (or his descendant, it depends on time travel fuckery) for Joy Boy.
As far as I know, we still don't know officially what era Ryuma lived in. Wano didn't really experience the Void Century the way other countries did, so, it's hard to tell.