Marriage between first cousins are allowed in Judaism.
aish.com writes explicitly
It is permitted under Torah law for cousins to marry. In fact, the
Sages seem to view marriages between relatives as desirable. The
Talmud recommends that a person marry his niece (Yevamot 62b).
[...] The assumption is that a
person will have an especially close relationship with a close
relative, perhaps because of their likely similar personalities and
values. The reasoning may be the same for a cousin, but the Talmud
doesn't mention it. (I should point out that for a woman to marry her
nephew is forbidden from the Torah – Leviticus 18:12-13.)
Some point out that the daughters of Zelophehad married their cousins
(Numbers 36:11) so the practice has good precedent. [...]
In terms of the genetic issues, [...] relatives who marry
should be even more careful to do genetic screening in advance.
Note that a number of countries and US states forbid first-cousin marriage though.
Mamzerim are the children of an adulterous or incestuous union (e.g., a man and a married woman or of a brother and sister - but NOT of a man to to an unmarried woman). Any decisions on the status of their children need to be considered by a qualified rabbi as there might be ways to disqualify the marriage (e.g., on technical grounds) and avoid the mamzer status.