The list provided by Hong Kong Immigration Department states Iranian citizens will need a visa even for transit:
IRAN (please see remarks) - Visa Required*
*All nationals are required to hold a valid visa for the HKSAR for whatever purpose (including those who are in transit and remain on the airside).
For completeness, if you also hold one of the following documents you are not required to have a valid visa:
No visa or entry permit is required for any purpose if you hold any of the following travel documents:
- Hong Kong Special Administrative Region Passport,
- British National (Overseas) Passport,
- Hong Kong Certificate of Identity,
- Hong Kong Document of Identity for Visa Purposes provided that the document is valid or the holder's limit of stay in Hong Kong has not expired.
- Travel documents bearing one of the following endorsements:
- "Holder's eligibility for Hong Kong permanent identity card verified."
- "The holder of this travel document has the right to land in Hong Kong. (Section 2AAA, Immigration Ordinance, Cap. 115, Laws of Hong Kong)"
- Hong Kong Permanent Identity Card.
Hong Kong operates a separate immigration system to China under the One country, two systems principle. Having a Chinese visa does not exempt one from the need of a Hong Kong visa, should they need one.