A fire engulfed a food and beverage factory outside Bangladesh’s capital, killing at least 52 people. Many were locked inside, officials said.