The health secretary, Matt Hancock, has defended Theresa May over her decision to hold talks with Jeremy Corbyn to end the Brexit deadlock, despite dismissing the Labour leader as a dangerous Marxist.

During a round of broadcast interviews, Hancock said Corbyn’s support for delivering Brexit trumped other concerns about him.

“It is important sometimes in life to compromise,” Hancock told BBC Breakfast. “The national interest is to find a deal that can command a majority of the House of Commons to leave.”

Corbyn and May agree to more talks after 'constructive' first day Read more

May’s decision to enter Brexit negotiations with the Labour leader prompted a furious public backlash by many Tory MPs and has led to two ministerial resignations so far. But Hancock said backbench opposition to May’s deal had forced her to turn to Labour.

He said: “We tried, by God we tried, to do that [get a majority on May’s deal] with votes on the Conservative side and with the DUP, and that clearly didn’t work after three attempts and months of work to try and persuade people, and so the only way that the prime minister could go was to talk to Jeremy Corbyn to look for Labour votes to support a deal to get us to leave the European Union.”

He added: “We have to work with him because all the alternatives have failed. I disagree profoundly with Jeremy Corbyn on a whole series of issues. On security matters he’s dangerous. On economics he’s a Marxist and he would undermine the prosperity of this country, but he leads a party that has a manifesto commitment to deliver Brexit … I think it is in the national interest to deliver on the result of the referendum because we are democracy.”

Hancock hinted that he would be prepared to support a customs union as part of a Brexit compromise with Labour, but suggested he would draw the line at a second referendum. He said: “I’ve spoken out against a customs union, but I do want to see an outcome from these talks that can deliver Brexit.

Brexit: bill to prevent no-deal passes Commons by one vote Read more

“A second referendum on Brexit doesn’t deliver on Brexit and would require a longer extension to organise … A second referendum isn’t about delivering Brexit, it’s about having another go. I have spoken about my very deep concerns about a second referendum because it would be divisive but it wouldn’t be decisive.”

On Wednesday the chancellor, Philip Hammond, was more positive about the possibility of a second referendum. Speaking to ITV’s Peston programme he said: “Some ideas have been put forward which are not deliverable, they are not negotiable but the confirmatory referendum idea, many people will disagree with it, I’m not sure there is a majority in parliament for it, but it’s a perfectly credible proposition and it deserves to be tested in parliament.”

Hancock also said there was now only a slim chance of the UK crashing out of the EU. Asked about the prospects of a no-deal Brexit on BBC Radio 4’s Today programme, he said: “I think that they are very unlikely because of the bill that the House of Commons passed last night. That would make it the law of the land that the prime minister has to seek an extension rather than go for no deal. So I think no deal is very unlikely, despite the that fact that in the NHS we have done enormous amounts of preparation to make the country ready.”

Shami Chakrabarti, the shadow attorney general, confirmed there were divisions in the shadow cabinet over support for a second referendum. On Wednesday the shadow foreign secretary, Emily Thornberry, had said any agreement on Brexit should be put to a public vote.

Asked on the Today programme whether she agreed with Thornberry, Chakrabarti said: “A public vote became part of our policy for the purposes of breaking deadlock. It is not an end in itself.”

Asked if there would be a shadow cabinet vote on a second referendum, she said: “If we are split then at some point there might have to be a vote. But we are a very united shadow cabinet. A public vote or a general election remain the means of breaking deadlock in the country and one or other of those is very likely, it seems, in due course.”