Most flats are on leases. There will be an express term in the lease of each saying that pets are not to be kept, or only certain types, or a given number etc. There are usually rules, contained in a document annexed to the lease, for the good governance of the block or building, where the more fussy details of what and what is not allowed are set out; such things as rules about bicycles in hallways and putting out bins are often to be found in these;and these rules are incorporated ito the lease by a clause saying so, thus making them part of the lease.
If the document is silent on,say, pets, there is no rule or clause and you are governed only by the general law relating to nuisance, public health, keeping wild animals such as lions (!) etc
With freeholds, it is still possible to have rules on the basis that they affect other freeholds.Developers often include them to maintain the standards of an estate. These require care in drafting because they are not always enforceable and are effectively meaningless.