A Palestinian teacher who grew up in a refugee camp has been named as the most exceptional teacher in the world, winning a $1m prize.