There is nothing in law to stop them, but ... why would they? Sure it would let them get things through parliament very easily, but what would they want to get through parliament. The two main parties in the UK disagree on the vast majority of policy areas - that's why they are different parties. If there was a clear shared agenda, they would likely form a party around that.
It's also worth noting, from a practical point of view forming a coalition with the party seen as your main rival would usually severely damage your credibility with your voters, and would likely make re-election difficult.
There are situations where this makes sense. In times of crisis, countries are sometimes led by a so-called "Government of National Unity" or "National Government" (see here and here for a more UK-centric point) but these are very rare as they require a crisis so great that the political differences between the two main parties are rendered irrelevant (in practical terms this usually means a war).
Another point worth making is that in one area of the UK, this is compulsory! The Northern Ireland executive requires power to be shared between the largest Republican party (which is usually also left wing) and the largest Unionist party (usually also right wing). The executive is led by the First Minister and deputy First Minister who have the same governmental power, resulting in a duumvirate. This was designed to ensure that both Republicans and Unionists felt represented in government. The downsides of such an arrangement are now being keenly felt, as the Sinn Féin and the DUP currently have seemingly irreconcilable differences which has caused the power sharing to collapse and has caused a crisis in Northern Ireland, since there currently is no executive and there cannot be one until the parties come to an agreement.