"How many hot dogs do you want?" asks the vendor. Suddenly, the man on the other side holds up his middle finger. Before too long, there is a fight going on, and all the man being beaten can think is, "What's so bad about wanting three hot dogs?"
All over the world, customs are different, and not learning (or not adhering to) these ways of life can cause some pretty akward circumstances.
The phrase is a common one to tell others to "act like those around you," so you don't either embarrass yourself, be rude, or just make a social goof-up.
Not much can be worse than praying to Jesus in the middle of ancient Rome (well, when they killed Christians, at least).