Sand the baseboard with an orbital sander, using course, 60-grit sandpaper. Move along the length of the board to reduce the distorted areas to the same plane as the surrounding non-damaged baseboard. Follow this with a medium, 120-grit sandpaper. There will likely be holes or voids in the baseboard when you're done.
Fill the low areas with auto body filler using a putty knife. Press the filler into the openings and scrape the putty to as close to level with the baseboard as possible. Allow the filler to harden completely.
Sand the filler area using the sanding block and fine sandpaper to remove high spots left by the filler. If necessary, add more filler and repeat your process.
Prime the repaired area with a water resistant primer recommended for fiber board applications. When using MDF as a baseboard, the material must be completely protected from water. This means that you have to prime all sides of the wood, even the cut edges.
Paint the MDF with at least two coats of a water resistant paint. Allow four hours between coats.