... I am sure you know that in "Spain" there are different cultures (and languages) and each one has its own ways, right?
In Catalan language for example, it's customary to say "bon dia" (good morning) rather than "hola". The later is far too informal and you'd most likely use it in a different scenario (not when entering a store, for example). Having said that, some local people also use "hola", however this greeting denotes some degree of familiarity with the other person, which is not normally the case for a visitor coming on holiday. I would say that Catalan is in between Spanish and French when it comes to formality in the manners. The term for "good bye" better illustrates this, in Catalan you'd formally say "Adeu ciau", you can also use "adeu" if you want to be a bit more informal, and if you have a degree of familiarity with the other person sometimes you'd shorten it to just "deu".
Obviously, as in many other languages, not all native speakers have the same manners nor the same understanding of "proper" talk, so you can probably find all sorts of responses.
But again, you won't be frown upon if you break protocol moreover noticing a foreign accent.
What I can tell you is that if you visit Barcelona or any other part of Catalonia, you'll put smiles on a lot of people's faces if you try some Catalan words/sentences even if it's just to break the ice and then continue the conversation in English or in Spanish as this is seen by native-speakers as a great sign of respect towards a minority language such as Catalan (spoken "just" by 10 million people in Spain, France, Andorra and Italy). Should you want to try.... http://wikitravel.org/en/Catalan_phrasebook