We don't say "ciao" in Italy.
Well, we usually say "ciao" to greet friends, relatives or someone we are very close to, but we would never say "ciao" in a formal situation. It is a very informal and familiar greeting, and you can't use it whenever you like.
Italy is one of the most-visited countries in the world, so it is likely to hear tourists say "ciao" when greeting staff in a restaurant or hotel.
I hate to break your heart, but an Italian native speaker would say "buongiorno" or "buonasera" when entering a restaurant and "arrivederci" when leaving.
Each country has so many different ways to greet people, and I admit it is hard to remember all of them!
So, next time you visit Rome, Florence or Verona, I hope you'll remember my hint.