Yes it will as long as you make sure the rocks are clean, too big to be eaten, and don't get too hot. If the rocks get above 110 degrees in surface temperature, your bearded dragon can get burns on its feet and underside.
Worse yet, it won't feel that it is burning because they get their heat by basking unlike a leopard gecko who needs heat underneath it.