States are different. Here in New Mexico, only registered Republicans are allowed to vote in the Republican primaries, and Democrats likewise. Independents don't get to participate in the primary process, unless they register with a specific party. In states with "open" primaries, any registered voter may vote in any primary (but only one).