What would happen if say all parties refused to form a coalition with the party with the most seats, which then resulted them not gaining a majority of 326 seats?
A majority government is not necessary for conservatives and Theresa May to remain in power. They simply wouldn't be able to pass laws on their own anymore which presents problems, but doesn't really mean anything in terms of a different leader.
Most probably the Tories will form a 'working arrangement' with the DUP in Ireland who share similar beliefs and policies. This will push them past the majority line and allow them to pass laws.
It is important to note though that this is not the same as a coalition.