Bonsly can't learn Wood Hammer, but Sudowoodo can. You can teach Sudowoodo Wood Hammer from the Move Relearner. The Move Deleter and Move Relearner are in the house north-east of the Pokémon Center in Dendemille Town.
Torterra can learn the move the same way as Sudowoodo
Sources: Torterra page, Wood Hammer page, Sudowoodo page