If you're playing Pokémon HeartGold hoping to catch Dialga, you're out of luck. The Temporal Pokémon is a version exclusive, available only in Pokémon Diamond (and Platinum) within Generation IV. HeartGold and SoulSilver, despite being Gen IV remakes, lack direct trading compatibility with Diamond, Pearl, or Platinum for this purpose.
No in-game events, glitches, or hidden methods grant Dialga in HeartGold. The only legitimate route is the multi-generation transfer process.