This is neither encouraged neither discouraged rather this is permissible. Zainab, may Allah be pleased with her was the first cousin of the Prophet salla Allahu alaihi wa sallam.  Ali was the cousin of our Prophet and he married his daughter Fatimah may Allah be pleased with them.

Read more