Marriage is both a religious and a legal act in most cases, whether we are speaking of a civil ceremony, a religious ceremony, a common-law marriage, or so on. While there have been laws at various times and places throughout history preventing interracial marriages, these normally seemed to have derived from social values rather than religious (even when the arguments were biblical or theological). In ancient times, of course, some of the commandments against “marrying foreigners” in the latter part of the Exile period for Israel had to do more with foreigners who worshipped other Gods, not the mere fact that they were “foreign.” See Ezra 19, Nehemiah 13, for example.
Today is the 62-year anniversary of a California Supreme Court ruling that “anti-miscegenation” laws violate the Fourteenth Amendment of the Constitution. The case was Perez v. Lippold (1948) 32 Cal.2d 711 (aka Perez v. Sharp) concerning a Black man and a Mexican-American woman.
Maryland was the first state in the U.S. to pass an official ban on interracial marriages in 1664. When the Declaration of Independence was signed in 1776, seven states had such bans. Pennsylvania repealed their ban in 1780.
Nineteen years after the California decision, the U.S. Supreme Court ruled the same in Loving v. Virginia (1967) 388 U.S. 1.
The U.K. has never passed any laws that prevented interracial marriages, though there was social and political pressure against them. After WWI, there were some race riots and calls for such bans, but apparently nothing came of it.