Sure, replicators which replicate real things out of .... what? So there is an economy somewhere supporting that fantasy tech.
It’s fantasy. As is socialism. Except that in real practice, socialism is theft.
Out of energy, which comes basically free out of dylithium crystals.
It’s really no more fantasy than spice. And again, it is NOT socialism.