In some places, you can only vote for candidates in your own party - for the primary.
In Canada, there is a similar process in choosing party leaders, except you don’t register for a party. You buy a membership and you could be a member of all parties if you wanted to.