Gandalf uses whatever tone is appropriate for the circumstances in this and
other cases with the Rohirrim, but he knows the right tone to command
respect. Gimli is too hot-headed and doesn't know the right combination
of authority and appeal to hospitality (an important catchword in such
cultures) as does Gandalf, who is conversant in the customs of the
Rohirrim. He knows how to manipulate the guard and later Hama (getting
him to allow him to bring the staff into Meduseld).
As for the guard's shock, we should recall that the Rohirrim haven't seen
dwarves and elves for many years, and even in the past they would not have had
much commerce with other races. Just like the "holbyta," Gimli and
Legolas are the stuff of children's tales and legend to most of the
Rohirrim.
************************
"Elves and dragons! . . . Cabbages and potatoes are better for me and you!"
--The Gaffer