There is no law in the UK that prohibits a person from being crowned king or queen if they have been divorced.
This may surprise some who know their history (or have watched The Crown) as people will point to Edward VIII who was forced to abdicate to marry Wallis Simpson, an American divorcée. But this was largely due to societal and political pressure of the time.
In November of 1936, Edward VIII told the then Prime Minister Stanley Baldwin of his plans to marry Wallis Simpson once she was divorced from her shipbroker husband Ernest Simpson - she had already divorced US Navy pilot Earl Spencer Jr. in 1927 alleging that he was an abusive alcoholic.