How is the power dissipated equal to heat generated in an electric circuit?
Not necessarily.
If your electric circuit is a radio transmitter, then some of that power will come out as radio waves.
If your circuit is an LED and its driver, then some of that power will come out as light.