I've not done pit work, but I have done stage management and lighting design, so I think I can answer some of this.
The phone handset isn't for talking to the band. It'll be hooked up to a talk-back circuit - essentially a closed-circuit intercom system - that allows the stage manager, conductor, lighting and sound operators to talk to each other. If the show uses follow-spots, their operators will be on the talk-back too.
Music rehearsals will include lengthening parts of songs, cues to play riffs at odd places and repeat some parts. Those will be agreed between the music director and the show director, and be rehearsed seperately. It's not unknown for the actors not to encounter the band until the first technical rehearsal. They'll have been working with backing tracks up to then.
When a show does go off-piste - and you're right, pantos do do that - the people who keep it on track are the stage manager, the conductor and the lighting and sound people. The band will have rehearsed what might go off-script and be able to respond accordingly.