Jurisdiction: england-and-wales
There is no general right to do this. However, in some specific circumstances it can be possible to do this, or achieve a similar effect.
Leasehold enfranchisement
If you live in a flat and are a tenant under a lease (as opposed to a tenancy agreement), and meet various conditions, you can effect a compulsory purchase of your freehold under Section 1 of the Leasehold Reform, Housing and Urban Development Act 1993.
As an alternative to removing the landlord altogether, there is the "right to manage" under Section 71 of the Commonhold and Leasehold Reform Act 2002.
Local authority management orders
This applies where your property is either an HMO or a "Part 3 House" as defined in Section 146 of the Housing Act 2004. Without going into too many details, an HMO is a house in multiple occupation or certain blocks of flats which do not meet the requirements of the Building Regulations 2010, and a "Part 3 House" is any property which falls within a zone that the local authority has designated as a "selective licensing zone" (a zone in which landlords are required to have a licence before they can rent their property).
In such properties, the local authority can make an "interim management order" (applicable for no longer than 12 months) or a "final management order" (no longer than 5 years) which enables them to "[secure] the proper management of the house" - effectively permitting the council to take over management from the landlord.
There is both a duty and a right to make such orders and different conditions attach to each. The conditions which must be met for an interim management order are set out in Section 102 and for a final management order in Section 113. Broadly, these conditions relate the health and safety of the property and whether or not an HMO or Part 3 licence is capable of being issued.
Local authorities will generally use other measures available to them before considering management orders as a last resort.