@shayannegp This happens.
Without "mods", it happens. I use mods, but I do not use one to prevent this.
It seems to happen almost every time a "new" cook uses a stove or BBQ. By "new" I mean a first time.
My only advice is make sure to have the fire suppression system installed and the smoke detector (of course).
Eventually your Sims can upgrade the stove to be fire resistant or fireproof. All without cheats or mods.
The worsts one I had, I made a video. I didn't save the game. I just wanted to see what would happen if the fire wasn't put out.
https://www.youtube.com/watch?v=yTAnpo8sxDM