It can be relatively expensive, but that isn’t always the case. The price will depend on the location and size of the dent and on whether or not the dented panel will need to be painted after the repair.
Dent repair doesn’t always require a new paint job. As this paintless dent repair Arvada CO page shows, there are techniques out there that allow for even large dents to be repaired without damaging the paint.
The location of the dent is key, however. Paintless dent repair often requires access to the back part of the panel, and that is easier to do in some areas of the car than others.
Another factor to consider is the skill of the person making the repair. If performed incorrectly, paintless dent repair can take a lot longer or be straight-up impossible.
In other words: yes, dent repair is expensive. But it can be much less expensive under the right circumstances.