It can, but it shouldn't be. In a perfect world it could work because all people would vote in a manner that was in line with the will of God but we do not live in a perfect world. It would be better to entrust leadership in a pious individual like Moses rather than the rabble of Israelites who often turned away from God.