When a friend called Andrii Zarytskyi at 5 a.m., his voice shaking, to say the first bombs had dropped on their city of Mykolaiv, Mr. Zarytskyi didn’t believe him: The 32-year-old never thought he would witness a war in his lifetime. But as Russian forces drew closer, Mr. Zarytskyi, a gay man, understood he would have to run. “People are afraid that if they find out you belong to the LGBTQ community, they could just shoot because of who you are,” said Mr. Zarytskyi, a manager at LGBT Association LIGA, a 25-year-old advocacy group in Ukraine. In late February, he escaped with his mother to Odesa. The sounds of bombing and air-raid sirens wailing four times a day sent them fleeing further west and out of the country. In Moldova, friends took them in.