The short, the practical answer to this is “no”, you cannot sleep on the side of the road in California. There actually is a law (see below) that makes this illegal on “freeways”. This law spells out several exceptions, however sleeping is not one of them.