First and foremost, both Lydian Dominant and Altered can be regarded as “children” of the Melodic Minor scale in terms of their arrangement.
Lydian dominant : WWWHWHW
Altered dominant: HWHWWWW
(Strictly speaking, the seventh mode of Melodic Minor is not Altered but Super Locrian, but I disregard it in this discussion.)
So firstly, an altered scale shares the same constituent notes as a Lydian Dominant whose root is a tritone away.
However, why are these two specifically referred to as having an “inverted” relationship among the “children” of the melodic minor scale? —What’s more special is that these two scales share guide tones completely.
The 3rd/7th of G lydian dominant becomes the 7th/3rd of D♭ altered, and the 3rd/7th of G altered becomes the 7th/3rd of D♭ lydian dominant.
This is because their roots are tritone away to each other. This discussion is deeply intertwined with tritone substitution, and to put it simply, terms like “inverted” or “reversed” mean something similar to G7 and D♭7 being in a complementary relationship.
The 3rd/7th of G7 (B and F) becomes the 7th/3rd of D♭7, thus interchangeable with harmonic function preserved. In the world of scale, altered and lydian dominant kinda have this relationship.
Suppose you’ve grasped the scale tone and guide tone positions of G altered and can improvise fluently with it. Then, when you want to play the Lydian Dominant over D♭7, simply playing G altered not only aligns the chord tones but also aligns the guide tones perfectly, allowing you to firmly establish the chord quality of D♭7 (though the 3rd and 7th is reversed). This is convenient, isn’t it?
While other combinations can also theoretically exist, the Altered and the Lydian Dominant are particularly notable because they are both well-known as scales that fit over dominant seventh chords. This is why these two scales are seen as like “twins”.