If a dominant 7th is the major key of D for example. What would be the minor key and vice versa. If you know, please explain how.
Not sure what you need here, but a 'dominant 7th' is a chord produced using 1,3,5 and b7 of a scale - like C E G Bb. It cannot be a dominant 7th with a b3 (C Eb G Bb). That's called a m7th.
There's a vagueness about the terminology because we sometimes talk about the dominant of a key. That's made up using 1,3,5,7 , but starting on 5 instead. That's confusing, so really, it's made up with 5,7.9 and 11. In C, that'll be G B D F. Making the dominant chord in the key of C, but that's not C dominant 7th, as explained earlier. That is called G7, Gdom7th, and can also be used as the dominant chord leading to C minor.