Can I just solder an SMD part directly on the through holes of the PCB?
The pitch of SMD matches the pitch of the through holes.
For DIY project, no problem.
If you manufactured a large quantity then you'd have to care about having a low number of defects which means taking care of all the details. But for one-off DIY projects, yolo.
Unless there's something you're not saying, like the SMD part is a power transistor or LDO that needs a copper plane for heat sinking, stuff like that.