I don't think Moria is blood related to the Kozuki, more like he was adopted by one of the branch family.
My guess and how it went down:
*Moria was born in the West
*Adopted by a Kozuki Family who left Wano
*The Kozuki Family and the adopted Moria then returned to Wano
*Moria was then raised in the Ringo Region of Wano
*At some point Moria left Wano
*Moria then became a pirate after Roger's death
*Moria then learned about Kaido's rule over Wano
*Moria decided to go back to Wano, so he can defeat Kaido and save the country
*Moria and his crew then went to Wano, where he and his crew fought against Kaido and his crew at the Ringo Region
*Moria was defeated and his crew was killed, Moria himself managed to escape while at the same time stealing Ryuma's body.
