If you go to confession because you fear “the fires of hell” but not because of your love of God, per se, are you really forgiven? I am not suggesting someone who is blatantly against God. Rather, someone who goes to confession because his first driving thought to do so is “I better go to confession so I don’t burn in hell.” He or she is really confessing to save their own skin, as it were, not because the sin hurts God.
Yes, fear of punishment is sufficient to receive sacramental absolution. It is more formally known as attrition, as distinguished from contrition (sorrow for sin arising from love for God). While sufficient for absolution, attrition is not sufficient for the forgiveness of mortal sin outside of sacramental confession (as is perfect contrition, assuming confession will be sought if possible).