For Herod had seized John and bound him and put him in prison for the sake of Herodias, his brother Philip's wife, because John had been saying to him, “It is not lawful for you to have her.”
Matthew 14:3-4

Herod was an Edomite, not an Israelite, so what basis did John have to accuse him of violating the Law of Moses? God gave the Law through Moses, but it is universal. The Law expresses God's standards of behavior for all people, not just the Jews.