Sort of, Yes, there are even some examples that Marx references himself.
Describing a case of slaves turning against their master, Pliny the Younger referred to the “dangers, indig-nities, and mockeries” that slaves impose on their supposedly kind masters, for their “brutality” leads slaves to murder and rebellion. The Roman historian Florus saw Spartacus’ rebellion not as a monumental struggle for liberty but as a disgraceful undertaking, perpetrated by slaves and led by gladiators, “the former people of the lowest class; the latter, of the worst.”
So I don't think it's unfair to say that knowledge of there being a rich and a poor and ergo some sort of 'class' divide was understood at least as far back as Spartacus's era.
Yes, absolutely, assuming by 'socialism' you mean the organised movements which emerged in the 19th century.
One situation which has attracted a lot of attention from historians looking for 'proto-socialism' or 'proto-communism' is in the radical groups which emerged during the English Civil Wars.
The historiography of these groups as 'proto-socialist' is somewhat controversial, it should be said. During the 60s and 70s 'Marxist historiography' was very much in fashion in the UK, and historians such as Christopher Hill placed great emphasis on the economic and class aspects of the Civil Wars, and interpreted Cromwell's takeover as a 'bourgeois revolution' which overthrew the old ruling order but then ultimately sidelined more radical groups in favour of empowering the bourgeois middle class. In the decades that followed, however, historians argued that this approach placed too much stock in economic and class factors and ignored religious and constitutional factors, and 'Marxist' history fell out of vogue.
That said, 'class' was undeniably a factor in the thinking and actions of many groups involved in the events of the mid-17th century British Isles, and I'll try and give you a few examples you could look into further if you wanted.
Some groups, such as the Scottish Covenanters, actively courted support from 'all ranks' of people, and included marginalised groups like lower class men, and even women, in their movement, but did so in manner which remained very conservative, emphasising that all people had a duty to defend their religion, but shying away from making any arguments about economic issues or power structures which might be seen as too radical.
The classic example of civil war class consciousness is the 'Levellers', although again their focus was often more political and constitutional than it was economic. The Levellers were a faction of Cromwell's army who sought an expansion of the voting franchise to all adult men and various other forms of electoral and political reform and anti-corruption measures. So they definitely had a strong class aspect to their politics, though it was not necessarily very close to later ideas of Communism.
The most radical in terms of economic issues were the 'Diggers', a group who advocated for common ownership of land. They have often been written of as precursors to later ideas of socialism or left-wing anarchism, and actually attempted to form several political communities which would now be termed communes in the south of England, which were harassed by local aristocrats and Cromwell's army, and did not survive very long.