is it possible to inherit a kingdom?

i.e you prince/ princess marries the daughter/son of a rival kingdom.

is it possible due to lack of alternative heirs that your "child" inherits the throne, and if so what would happen - the rival kingdom continues to exist independently or joins your kingdom?

another question - can their be female rulers, or do they exist soleley as the spouses of the ruler