You should not. Batoning drives impact and lateral load straight through the pivot and the lock, which are the two parts of a folder least able to take it. Even a strong lock is a mechanical joint, and repeated impact loosens or damages it. Use a fixed blade or a saw.
Each hammer blow on the spine transmits force through the blade into the stop pin, the lock bar and the pivot. Those parts are sized for cutting loads, not impact. There is more on a folder's pieces in the parts of a pocket knife.
The failure mode is usually gradual: developing blade play, then lock rock, then a lock that no longer engages reliably. By the time you notice, the knife is compromised.
A lock that fails while the blade is being struck closes the knife on your hand. That is the specific reason this is a safety answer rather than a durability one.
Manufacturer warranties also generally exclude misuse, and batoning a folder is squarely in that territory.
A four-inch full tang fixed blade batons safely and costs less than most folders. A folding saw does the same job faster with no risk at all.