The political parties can almost do whatever they want. The DNC fought for this in court after 2016. They can legally cancel all of the remaining contests and crown Jamie Dimon as the nominee if they so choose because they are a private organization, albeit one which has burrowed itself into the state and federal government.