If your gas fireplace is equipped with a standing pilot light then yes the gas fireplace will operate without needing electricity so the gas fireplace will work when the power goes out.
That's one good reason to have a gas fireplace that needs no electricity to operate because you'll have a backup source of heat.
The gas fireplace will still produce heat while the power is out but because the power is out it won't have the blower running to spread the heat around much better so it may take longer for the heat to heat room up but it's still very safe to use the gas fireplace without electricity.