It's not always 100% necessary to sand before painting your baseboards, but lightly sanding your baseboards before painting will help give the paint something to adhere to. It will also provide a nice smooth surface, which looks more professional.