In Pokémon HeartGold (and SoulSilver), QR Codes are a built‑in feature used to share and register Pokémon into the Pokéathlon and the Pokédex’s “QR” data. Each Pokémon has an associated QR Code that encodes species, Trainer ID, personality data, and other identifying information, allowing players to quickly import a Pokémon’s data into another cartridge’s Pokédex or Pokéathlon records without trading the actual creature.
Warning: Typing hex codes is tedious. The "QR codes" you see online are often these codes converted into a scannable image for PC emulators only. Do not scan them with a cell phone; they will just show a string of numbers. Pokemon Heart Gold Qr Code
All of these were tied to Nintendo Wi-Fi Connection (shut down in 2014) or in-life physical events. You cannot trigger them with a QR code. Pokémon HeartGold QR Codes — A Detailed Guide
Since official Nintendo Wi-Fi Connection services for the DS ended in 2014, you cannot use standard internet features. However, you can still access these features using a DNS exploit: Go to your Nintendo DS Wi-Fi Settings. Select your connection and change "Auto-obtain DNS" to No. MelonDS or Desmume (DS emulators) PKHeX (save file