In practice, socialism didnt work. But socialism could never have worked because it is based on false premises about human psychology and society, and gross ignorance of human economy.
Man is not made for the State but the State for man and it derives its just powers only from the consent of the governed.