All communism or socialism directly imply is that the means of production is not held privately, but by some kind of collective communal or social entity. This is often the state, but was often imagine to be some kind of community council or representative entity.
The distinguishment between that hypothetical entity and the 'state' as we know it is certainly up to debate, but I wouldn't therefore say that anarchism and communism or socialism are therefore contradictory.