Sort of… Under Socialism workers control the means of production. That’s it, it can take a lot of forms. Communism, however, is a stateless, classless, moneyless society. There’s no need for a state to own everything anymore, or a need for a state at all, because there’s no class antagonisms any longer, and no need to secure the means of production on behalf of the workers. Communism is more of an aspirational mode of being in that sense, but there are socialist states that worked or are working towards those ends. The “tyranny” you’re referring to is more part of the transitional era where you need to have a strong state that can suppress and liquidate the bourgeoisie in order to keep control of the means of production.
I don’t think we know enough about the economics of the federation to say either way, but it certainly doesn’t appear that there are distinct classes of haves and have nots, making it basically a communist society.
We can’t get to the Star Trek future unless we can limit the “rights” of capitalists in some way. In fact, we won’t have any future on this planet at all, since they seem hell bent on destroying all biodiversity in the name of profits. If stopping them is called dictatorship, then sign me the fuck up.