My theory and understanding of the to topics are this:
Dragons are mythological creatures, so in order to defeat a mythical creature is another mythical creature.
A similar aspect goes with ghosts. Since ghosts are, in a sense, wandering spirits, they are invulnerable to physical damage. So that pesky question of how to harm a ghost? Vacuum cleaners? Nope, other ghosts.
So, in all aspects, it's sort of a fish eat fish relationship with ghosts and dragon types. Hope this helps.