Depends on who you define as the best friend. Qamar and Najm along with Rahat and Alya are probably the best friend in the purely platonic since and all of them would 100% bail on each other if they had to choose between staying together and not getting with Leopold. Qam and Najm would be bummed about it, but I reckon that Alya and Rahat, as much as they like each other as people, would take the random disappearance of their counterpart in stride, Rahat more so than Alya.
This is mostly due to the fact that working in the Tazdahir means that anyone you care about could die randomly at any time, Rahat grew up with that and is used to people appearing and disappearing in their life. How troubled they are about cutting ties with someone they care about directly correlates with how long they've lived in the Tazdahir, with Rahat being the least bothered and Qam being the most bothered.
The answer changes if the best friend is someone you love both platonically and romantically, i.e. Rahat X Qamar and Alya X Najm. Rahat still wouldn't marry Leopold, they'd almost never willingly endanger themself and being near Leo radically increases your chance of death. Najm wouldn't either, they hate Leo more than they love Alya. Qam might, one of the few reasons that they're still alive is their relationship with Rahat, and that would be compromised by being married to Leo, but not as much as them being completely cut out.
Alya would marry Leopold if it meant they could still be around Najm, they don't hate Leopold, they don't really care either way about him, they think that being under the thumb of someone like Leopold is inevitable and they even have a certain level of respect for him. Alya just thinks that they could run the corporate empire better than he can. Alya loves Najm enough to risk their own safety, but also thinks they're smart enough to bend Leo to their whims.
I'd like to clarify: I don't believe what Alya believes, but I think that Alya's beliefs are completely normal for their circumstances as someone who has spent their entire life being controlled by a system that they have been told is meritocratic, and has treated them like they're nothing. Anyway, this thought experiment is kinda moot, because Leopold thinks that prolonged contact with the poor will give him viruses, so would never marry into the lower class. Which he perceives as pretty much everyone, except maybe the Curator, who is his sister.