Dialga appears in Pokémon Legends: Arceus via Space-Time Distortions in the Obsidian Fieldlands (post-game).
Must have caught Arceus (completed "The Plate of the Lakes" / "The Plate of the Moon" requests? Actually: Complete main story → "Seeking the Remaining Plates" → catch Arceus at Temple of Sinnoh). Dialga spawns only after Arceus is caught.
Other games: Dialga in Diamond/Pearl/Platinum (Spear Pillar), Brilliant Diamond/Shining Pearl, GO (raids). Methods differ.