It's been a long time since I've gotten to play that part, because I don't play Darkness or Sky much anymore. Tell me please if you can!
Essentially, Dialga becomes corrupted with the ruptures in time and descends into darkness, becoming Primal Dialga. This was caused by Darkrai stealing the Time Gears.
The Dialga you fight in a boss fight in PMD is not Primal Dialga; Dialga only becomes Primal when the Temporal Tower collapses as a result of the disturbance in time.
Primal Dialga