If their is a truly deadlocked convention (several ballots with he the leaders getting FEWER votes after the later ballots) then anyone could be nominated who was Constitutionally eligible, whether or not they had dropped out or endorsed another candidate. A number of GOP leaders, more than 10 less than 30 would go into a room and stay there until most of them agreed on a candidate. They would come out and word would be passed around. If the candidate's name was not already before the convention the rules would be suspended and the name nominated and seconded. Likely he would be nominated by acclamation.
This is extremely unlikely to occur.