Since you live in California, make sure that you understand the "Green Sticker" issue:
http://www.dmv.ca.gov/vr/ohvredgreen.htm
Many of the desert areas you can get away with riding without the required sticker, but you are taking a risk. If you ever intend on riding any of the forest areas the proper sticker becomes mandatory because you usually have to pass through a ranger kiosk and they will check. You will also need a US Forest Service approved spark arrestor.
For the sand dunes: I am not sure of Glamis or Dumont but I believe that Pismo is fairly well enforced so I would highly recommend having the proper sticker there.
Have you actually riden a bike in the sand? I hate the sand on a bike. It is a blast on a quad but it is a lot of work on a bike. If I intended to go mainly to the sand dunes, I would buy a quad.
That said, the sand is the one place where bigger is better. In the desert and trails just about any size engine on a dirt bike will have you outrunning a quad. When you get to the sand dunes, those 600 Raptors will definately have the advantage.
I would recommend a 450 four stroke. At the sand dunes, half the fun starts when the sun goes down, so you will want a bike with a headlight and tail light.
So, I recommend a Yamaha WR-450F.
Your price range will almost get you a new bike. If you buy used, I recommend that you buy one with a green sticker and proper title. I believe 2005 and newer will be green sticker, but the older WR-450Fs were red sticker bikes.
Rod