According to this question, a Pokemon knowing the Whirlpool HM can be transferred from HGSS to Gen 5 by first trading it over to Diamond/Pearl/Platinum.
By extension I presume this means a Pokemon with Defog can be traded to HGSS and then transferred to Gen 5? What other HMs can be transferred to later generations? (Including Virtual Console if possible.)
OK using sumwun's comment above and some manual testing, I've come up with this.