Thats how I did it. A ton of crap came out of the dry rock, during the cycle the bacteria die and poop all over the place. It's easier to get out when you can see it on the floor of the tank, so you don't have a bunch of rotting organics hiding in the sand and fertilizing algae.
If you read about "cooking rock" (it's nothing to do with the stove) it can be really beneficial to run the rocks in water without lights for a while. The phosphate will leach out into the water but without a light source you won't have algae growing from it. Depending on the rocks there can be quiet a lot of phos in them. Cycling without sand is basically cooking rock. You can even run lanthanum chloride to speed up the phos leaching easily if needed, or just gfo and water changes.
Doing this in the tank while the bacteria is colonizing your rocks is like killing two birds with one stone. You have to rinse the sand really well before you add it but it's nbd that it makes the water a little cloudy. There's still phos and silica in the sand, so there will be some algae like always, but mine was nowhere near as bad as some people who used the same rock as me.