Thousands of Israelis have rallied in the town of Beit Shemesh against ultra-Orthodox Jewish extremism.