There are any number of products that you could use to repair this damage prior to painting. Some products are much harder and more durable when they have cured or dried. A good part of your choice will depend on the relative ease of the work it will take to sand down smooth and level once the patching has been done. It turns out that the harder more durable products also tend to be harder to sand as well.
Regular wood filler would work for you but you may also want to investigate one of these types:
- Spackle (not the "light" stuff). This does have a tendency to shrink a small amount if it is put on too thick.
- Water putty (which usually comes as a powder that you mix with a small amount of water) applies easily. The stuff I have used tends to dry rock hard and can be very difficult to sand down. Most common use for water putty that I have seen is in floor crack repair.
- Bondo which is a two part material usually destined for automotive use can work well for a job like this. It becomes very durable when cured but is still sandable.
With any of these materials there a number of things that you definitely want to keep in mind:
- When sanding any of these materials make sure to use proper breathing protective gear.
- Any of the facing layer of the plywood on the side of that cabinet that is loose will need to be cut away so that you are not trying to apply filler next to or on top of loose veneer.
- Some fillers may very well not bond very well with the existing smooth finish on the cabinet. Make sure to sand with a relatively coarse sand paper to remove the gloss and roughen the finished surfaces adjacent to where filler would be applied.
The last comment above can apply equally to how you may need to prepare all the other cabinet surfaces if you want a durable paint job. Besides the finish itself cabinets can have a lot of oils from hands and cooking on them. This also attracts dirt to the surface. These will need to be very thoroughly cleaned prior to painting.