My brother took multiple up-close pictures of a stack of burning diyas (a type of candle); to the naked eyes, the candles looked very bright. Can such up-close photography damage my iPhone’s camera, or its sensors?
No, taking pictures of candles, fires, etc., cannot damage your phone's sensors. There's just not enough energy emitted in the optical and infrared spectrum from candles and fires to cause damage to the camera.
If there's any damage to your phone's camera or sensors, it would come from heat from being close to the fire. But that type of heat damage would damage a person holding the phone well before the phone were damaged. Perhaps the phone's battery, or overheated electronics chips in the phone, would be the first casualties of excessive heat. But again, the person holding the phone would feel the effects first.