Dc Encoder Back and forth

A piston is a linear device.
It is the arm at the back of the piston that is non linear which is in turn in most cases connected to a CAM movement to perform the forward and backward translation.

Angular to linear / planar movements.

All three motor types are capable of PWM in some way

A stepper motor is normally 1.8 degrees per step but you can also use microstepping with the correct drivers to divide those by 8 = 0.225 or 16 = 0.1125 per step.
There are other drivers that can take microstepping to crazy low numbers.

It can be a little harder with cheap servos to microstep.

If control is what you seek then a stepper motor for sure as it can do both rotary and cam type movements.

You really need to consider the types of connection from whatever motor you end up choosing to whatever type of piston, bellow, etc.