Nearly two years after being driven from its stronghold in Yemen, one of al Qaeda’s most dangerous franchises has entrenched itself in the country’s hinterlands as a devastating war creates the conditions for its comeback.

In the provincial capital of Al Mukalla, where al Qaeda governed for a year, some residents are beginning to express nostalgia for the extremist group. Since al Qaeda’s 2016 ouster from the port city by forces backed by the United Arab Emirates, the conflict has stalled much-anticipated development and sparked...