My UK Tier 2 visa expires at the end of May. In the meantime, I am waiting for my work permit to Denmark.
In case I do not get my Danish work permit by the end of May, how long can I legally overstay in the UK after my visa expires?
I called the Home Office today to explain about my case and I was told that I could stay in the UK for up to 28 days after my Tier 2 visa expires.
AFAIK there is no such thing as a 'legal overstay' without another pending application for the UK. I was in this situation last summer; student visa was expiring and I was waiting on a French work visa, did not want to go back to the US in the meantime for financial and logistical reasons. The UK border force was extremely reluctant to even let me into the country with this information because "if your visa is delayed, you cannot overstay".
So what I take from this, and what I think you should as well, is that unless you apply for and are granted an extension, you cannot overstay whilst waiting for another visa unless that visa is a UK visa.
There is a 28 day grace period, but that is for people whose tier 2 visas are ending and who are applying for another UK visa (not the case for you).
I strongly advise you to leave the UK before your visa expires, or you could be barred from further entry and further visa applications. This overstay infraction would be noted on your UK immigration record, and there is a strong possibility of information-sharing between UK and Schengen or other countries. Therefore it would also look bad for any country you want to move to in future.