As far as the United States flag – HOAs CANNOT PROHIBIT FLYING THE US FLAG. Federal Law trumps your governing documents.

For your reference: Freedom to Display the American Flag Act of 2005 . Public Law 109-243, 109th Congress

TIP: your HOA may have guidelines that are specific to flag & pole sizes & location.