How can electrons manage to be at the same distance from the nucleus at all positions in p, d and f orbitals?
I think you're confusing what the orbital shapes represent. The shapes are probability distributions-which means that you're most likely to find the electron somewhere within the shape.


  Electrons can only be at a fixed distance from a nucleus 


This is false


  which is determined by n quantum number


The n quantum number tells you how big the orbital is-not precisely how far away the electron is.

In reality, the electron is moving around the atom, and is probably somewhere within the orbital shape.