AFAIK this is far more common in muslims but not in hindus, jains etc. While growing up I had heard/read that as per the Vedas you can not marry someone with whom you have a common ancestor within 7 generations. [My scientifically minded atheist parents agreed with the idea.] Of course, in practice this isn't always followed but in any arranged marriage such proscriptions would presumably be checked.