The purpose of matrilineal marriages is for the children of that paring to belong to the dynasty of the mother yes. Which is useful if the player has only female children or if Basque, and eldest is female. Also, why to use this type of marriage is to bring more titles into the dynasty, thus increasing the prestige of the family at large, which children get a part of at birth, and prestige is used in the scoring process. Also, members of a dynasty are automatically allies. Now, whether they can come into a war or not depends on certain factors. Like, if they like the other person. Also, they can if they are vassals under a common liege, such as the Dukes of Anjou and Brittany being of the same dynasty under the King of France. This also works if the characters are independent. Like a MacAlpin as King of Scotland and another MacAlpin as King of Jerusalem, with no emperor over either one of them. They are allies. If one is a vassal, then the one outside that realm. (vassalage) cannot aid, until the former member, the one that is in vassalage, breaks from that vassalage, and is independent.
Children inherit the titles their parents have, which they in turn, give to their children. I believe it can last like three generations. This can be removed if they go to war, or someone on their behalf, and they lose.
A Kingdom, duchy, etc will still continue on, so long as the rules allow for a different dynasty to inherit. Like how seniority is different that say primogeniture. In Primo, the first born, usually male inherits despite dynasty, Seniority, it it the oldest in the dynasty itself. Be that a brother, or a far removed cousin. Hope that answered your question. If not tell me how I can better clarify things for you.