As jax posted, It would depend on where it hit the pole.......some poles are behind the fence and some are the end post of the fence....so if the ball hits the foul pole ( although it should be called the fair pole, I am a traditionalist and call it what it has always been called.) above the fence it would be a home run....below the fence it would be in play and all the runner could get.
A ball striking the foul pole above the fence is regarded as "out of the park" even though it could rebound back into the field of play. It is a home run...