Donald Trump’s blustering about “illegality” to the contrary, the Republicans could indeed legally deny him the nomination, as unlikely as that might be. While it is true that under the current rules, his nomination could not be prevented; those rules could be changed at the convention before the voting on a nominee takes place. The rules committee has 112 members – two from each state and territory, plus DC. If a 57 person majority could be organized to change the rules, they could vote to require the nominee to get perhaps 1800 votes instead of the prior magic number of 1237 that Trump has exceeded. (He actually has 1542 pledged delegates.) Or rules committee members could decide that despite the individual state rules, they could reach a decision to unbind the delegates, making them free to vote their consciences (although some believe that none of the delegates are actually bound in the first place). It would then require a majority of the convention delegates to affirm their decision. If that happened all hell would break loose.
No lawsuit against the move would be upheld because the Republican Party is a private organization that governs itself. But there are likely too many problems to make a revolt a reality. First, there is presently no person of prominence such as Romney, Bush or Ryan who is known to be willing to run, except for those in the uninspiring cast that ran against him, including the hated Cruz and the unexciting Kasich. Cruz has 559 pledged delegates and would thus need 678 defections to get the nomination if 1237 was still the number. But the biggest problem would be the revolt of many of the 14 million supporters Trump had in the primaries, which would divide the party even further. That has to be weighed against the probable loss of the Senate, if a toxic Trump wins. Either way, the GOP is up against a rock and a firing squad.