I don't know about the tracks, but I'm not surprised that rocks are better than sand for R2. The sand could mess with his wheels/treads, but on the rocky ground is a bit more solid where we see him and he could effectively push smaller rocks out of the way as he rolls along. Heck, if he still has rocket thrusters he could even glide a bit over bigger obstacles. The sand might be better for threepio because he kind of shifts and twists along and can't raise his legs very high. If he ran into bigger rocks, he'd be pretty screwed, and might easier lose his balance on pebbles being bipedal.
Outside of mechanical ability, I think R2 was either looking for shelter in the rocky terrain or had some concept of where Obi-Wan might be living. The fact that he leaves the Skywalker ranch heading in just the right direction to find Obi-Wan might support the notion that he had some idea of where Obi-Wan was hiding out. I think Threepio considered himself superior to R2 in many ways and just felt like he should have the say in where they go.