You cannot hammer on a pulley especially when the pulley is on a shaft of a motor, power steering pump or other pump or shaft which could be damaged.
Hammering on a pulley can cause damage to the pulley and shaft and motor or pump that the pulley is being installed on.
For proper pulley installation it's best to use a special tool like a pulley installer and remover.
These tools are designed to both pull a pulley off it's shaft safely and also push the pulley back onto it's shaft.
Never hammer on a pulley that is going onto an electric motor or other pump including a power steering pump as it can and will result in damage to the motor, pump and even the pulley.
For power steering pump pulleys the pulley should fit tightly on the shaft and be pressed on with a power steering pulley tool.
The power steering pump pulley should also be pulled off using the same tool without any hammering.
Pulley remover tools and pulley installer tools are not all that expensive and also make the job much easier and faster.
If you're installing a pulley such as on a mower engine or electric motor you can safely gently tap it onto the shaft with a hammer if need be but don't full on hammer it as it can lead to damage.