I think that Marx comparison is pretty wrong. Marx expected a global workers' revolution that would result in a classless society. He was an advocate of armed revolution against the bourgeoisie. As far as I can tell, anything he wrote about gun ownership was in the context of this armed revolution.
The second amendment reads, in full, "A well regulated militia being necessary to the security of a free state, the right of the people to keep and bear arms shall not be infringed." The notion of protecting a state lead by a capitalist, slave owning class (think about what "people" means in this context) is completely contradictory to Marx.