When I was on an HOA board in California about 10 years ago, the HOA could not do make CC&Rs or rules that were MORE THAN the city or state codes or ordinances.
Thus, if the city code said no more then 3 animals per house the HOA could not say only 1 dog and it has to fit in a purse.