It is always possible to flee from on undesired confrontation if the other party is surprised. It is never possible to flee from an encounter without some confrontation where the opponent party is in striking range. (See Movement or Manipulate, Breaking Off from Melee below.)
A party can always flee an encounter if it chooses this as an action. Whether or not the opponent party will follow in pursuit of the fleeing party depends on a number of following factors as determined by the DM. Normally, other factors not withstanding, pursuit will be given 50% of the time (01-50 = pursuit, 51-00 = break off pursuit).
Avoidance and Pursuit. See Additional Rules, Pursuit and Evasion of Pursuit.