There’s no real evidence for Spanish galleons in Hawaii before Cook, but there are claims that the San Juanillo was wrecked near Maui in 1578 and the Santo Cristo de Burgos was lost off of Kona in 1693 (or 1696).
No evidence, as far as I can tell, exists to positively identify these ships — which are lost Manila galleons — with Hawaii specifically. There’s at least one competing claim for the Santo Cristo; the enigmatic “beeswax wreck” near Nehalem, Oregon. Although that might seem too northerly for a Spanish galleon, the west-east route went from Manila to Cape Mendocino in what is now northern California, then south along the coast to Acapulco. So an off-course galleon might well end up in Oregon as easily as in Hawaii.
There is, apparently, some indirect evidence of contact in Hawaii before Cook, although not necessarily with Spain. For example, there was a Hawaiian word for iron even though there was no indigenous iron making technology and there are stories in Hawaiian oral tradition about visits from non-Polynesians. But they could just as well have been Japanese fishermen blown off course.
There is, from the Spanish side, some evidence that Spanish mapmakers knew about either Hawaii or the Marquesas, perhaps from a voyage by Juan Gaetano.
I don’t know why the San Juanillo is noted as being wrecked “near Maui” or the Santo Christo de Burgos as “off Kona,” but I believe that the source of the claim is Richard Rogers’ book Shipwrecks of Hawai’i.