Can a local authority legally prevent people from using or occupying a dangerous building?

Yes. The local authority is legally entitled to make an order restricting the use of a dangerous building until suitable work has been carried out and acknowledged by a magistrates’ court. These works are controllable by the local authority under Sections 77 and 78 of the Building Act 1984. In inner London the legislation is under the London Building (Amendment) Act 1939.