I normally like to base my models before undercoating, in this way I am gluing the base materials (ie sand or slate) to the raw base and not a partly painted base. Also the undercoat helps to cement the base materials. However not everything always goes to plan, sometimes I have a spraying session before I have a basing session.
This was certainly the case with my Inquisitorial Stormtroopers who were well painted before I started to base them. As I was doing a desert feel to these I knew I was going to use sand, but also wanted some rocks as well, so I used some slate from the Warhammer 40K Urban Basing Kit. Having added the rocks I then using PVA (white glue) flocked the based with some Games Workshop sand.
I do like the sand which has some small larger pieces of gravel, which adds a lot of nice texture.
The bases will be painted (which helps cement in the sand) and then drybrushed.
See the full workbench feature on my website.