The people were unharmed. The fire, on the other hand, presumably caused a lot of other damage or harm. So "harmless" or harmlessly" cannot be used: they mean "without causing harm", adjectivally or adverbially.
Here "escaped" is a copula verb, grammatically, and "unharmed" is a predicate adjective acting as subjective complement. Or perhaps some other structure can be devised to explain this sentence. But in the end it's a common idiom, based on the logic above.