Yes, the heater in your car can still work even if the AC compressor is not functioning. The AC compressor and the heater are two separate systems in your vehicle.
The AC compressor is responsible for cooling the air and removing moisture from it, which is why it's often used in conjunction with the air conditioning system. The heater, on the other hand, uses heat from the engine coolant to warm up the air before it's blown into the cabin.
So, even if the AC compressor is not working, the heater can still function as long as the engine is running and producing heat. The heater uses the heat generated by the engine's cooling system to warm up the air, so it should work independently of the AC compressor's status.