When I was younger, my family had a Jayco Swan. I couldn't tell you how many times we (well Mum

) cooked on the gas stove inside on our various trips, but it would be in the hundreds.
We had a dry chemical BE fire extinguisher mounted to the cupboard below the seat near the door, it was 2 steps from the stove, always clear once setup and if worse came to worse, you'd be headed for the door in any case. These days they've moved on to a pop-top for doing the grey nomad thing, but still have an extinguisher and fire blanket within 1-2 steps of the cook top.
So long as you have sufficient ventilation, in the swan we'd always have at least the window behind the stove open to carry away a significant portion of the fumes and prevent heat building up on the canvas above the stove, though often in concert with the door open to provide a cross breeze.
I don't think I'd choose to cook with the tent section closed entirely on a camper, but given ventilation and being prepared with an appropriate extinguisher and blanket within a couple of steps I wouldn't expect it to be any less *safe* than using a standalone stove.