Of course they're entitled to it, its a contract, part of their T&Cs
Ministerial and Other Pensions and Salaries Act of 1991 refers.
MP's leaving office are entitled to a quarter of their annual ministerial salary as severance pay.
Boris is entitled to £18,660.
I don’t know, but think, the pension arrangement for former PM’s has changed. It used to be that they received a pension equivalent to half their salary even if they had only served one day in the post. Even if it has changed I doubt that they passed anything which would detriment themselves. PM’s pension entitlements applied to the speaker too.
Regardless of any pension, if they can stretch any function, event, or meeting they attend to being loosely connected to business of state as a former they can claim expenses. The Public Duties Cost Allowance allows former PM’s to claim up to £115,000.00 per year - as done by Blair, Major, May, Cameron and starting soon Johnson.
www.gov.uk
Edit to add:
A tabloid source states that reforms put in place by Cameron give the PM a post retirement age annual pension of, at present, £40,000. This will doubtless be inflation and cost of living proofed, so will, over the years rise to keep pace.
A former PM is also entitled to a protective detail. This used to be a single officer many years ago, but doubtless, with the situation nowadays and the threat level could probably change from a single officer to a full team. All the costs of salary (to include pension contributions, etc), logistics and transport for the detail being met out of the public purse. So even with a single officer providing 24/7/365 cover that would be around the £200,000 mark, probably a lot more.
A former PM can also call upon use of an at public expense chauffered limo.