how to put components with thick legs onto perfboard

How many legs? If the legs are square you can sometimes fit them by squeezing the legs with pliers.

Otherwise drill. Hand drilling (just a drill bit + fingers) is far easier/safer for the PCB.