It is totally up to state (and party) rules.
For example: In California for the last primary, the Dems allowed the independent (non declared) voter to request a democratic ballot, but the Republicans did not. So, if you were Republican you could only vote on the Republican ballot. The...