It varies by state, but with the government entity that runs elections in that state - which is called the Department of State normally, even though diplomacy has nothing to do with it.
You can vote for anyone you want to in the general election, the final round where the winner actually gets the office. If the candidate you want isn’t on the ballot, you can write their name in. Party affiliation carries no formal weight at that point.
But the parties have control over the choice of their own nominees, the candidates entitled to use the party’s name and endorsement and resources, both financial and organizational. It so happens that the advance of the democratic process over the nation’s history means that the method the parties use to choose their candidates is now popular election by those voters who consider themselves to be affiliated with, and to share the views of, that party. Should Republicans get to help choose the Democrats’ nominees?
It’s easy to be confused by the fact that the government runs the primaries, but that’s as a courtesy to the parties and for the convenience of the voters, not anything more official than that. A number of local issues, not related to party politics, are also decided in those elections and it’s just easier that way. There are, btw, minimum voter levels required for a party to be considered major and thereby get its own primary ballot, but those requirements vary by state.
In earlier generations, nominees tended to be chosen at the parties’ national and state conventions, by delegates chosen by the party organizations. At the national level, only the format remains, as the delegates are now chosen in primary elections or caucuses by the voters themselves, not the party organization. Some states, like Massachusetts for one, have party state conventions to choose which candidates will appear on the primary ballot and which will have the party organization’s endorsement and resources in that stage, but the actual choice is still up to the voting public.
Believe it or not, the US does not have federal elections at all, it just looks that way every 4 years. What you see is 50 simultaneous state elections, which include choices of slates of electors to the Electoral College which actually chooses the President.
Other than voting in the primaries, no, there isn’t.
To the OP question itself, all a party can do if a distasteful candidate claims its name and runs in its primary is to publicly repudiate him and deny him the use of its resources.