Several options.
T-Nuts and bolts of plywood- the t-nut attaches to the underside of the plywood via teeth, it has threads in it to accpet a bolt. Also requires pre planning, and assembly prior to carpet installation, plus you need to find the holes once the carpet has been installed. Not hard if you have acess to the bottom, push a small drill bit through the carpet at each hole to locate it, then cut it out with a razpr knife.
For 2x4 (dimensional lumber) use lag bolts as long as you can. Put the base in place, drill a pilot hole, and rachet the bolts home. Make the bolts as long as you have material, 2x4 in the 2" dimension use a 1-1/2 to 1-3/4" lag bolt. Preferred to use the 4" direction and use a 3-1/2" lag bolt. Only way that base is moving would be due to wood rot, so seal the holes. Best method I know is to use silicone or rubber wehn you have a couple turns to go, push teh sealant under the bolt head and crank tight, letting it ouze out. IF you use rubber, runt eh bolt thorugh it and let it seal around the bolt shank.
I used rubber backed outdoor carpet, the rubber backing seals the bolt holes.