You can take out landlords buildings insurance and landlord contents insurance for flats that you let out. Landlords need to take out a separate policy for each flat. Note that, in general, the owner of the freehold of a set of flats will probably have buildings insurance for the entire building.
Homeprotect landlord buildings insurance can cover freehold properties that contain up to six leasehold flats provided that at least one freeholder uses one of the flats as their permanent home.