The Moon does not rotate on its own axis. If I am right, for something to gain a spherical shape it has to rotate on its own axis. We know that the Moon does not rotate on its own axis. How can this be?
The question is based on two false premises, that the Moon does not rotate about its own axis (it does), and that for something to gain spherical shape it has to rotate own its own axis (this is irrelevant).
Addressing the first premise, the translation and rotation behaviors of any rigid body can be described in terms of the translational behavior of the body's center of mass and the rotational behavior of the body about its center of mass. In the special case of an orbiting object that is tidally locked to a larger object, it appears to observers on the larger object that the smaller object is not rotating. For example, people on the Earth looking at the Moon. From the perspective of an object orbiting Venus, it would be quite clear that the Earth's Moon does indeed rotate about its own axis. Every object rotate about its own axis.
Addressing the second premise, rotation about its own axis has nothing to do with whether an object of sufficient size becomes more or less spherical over time. What matters is the object's mass and composition. A key concept in this regard is the potato radius, about 300 kilometers for icy objects, 400 kilometers for rocky objects.
Self gravitation is overwhelming for objects significantly larger than the potato radius. Sufficiently large objects are inevitably be drawn into a spherical shape over time because self gravitation overwhelms the comparatively puny chemical forces that would otherwise maintain the object's non-spherical shape. For small objects, it's self gravitation that is the puny force.
The forces that work toward making a body take on a more or less spherical shape scale roughly with the cube of linear size. The size of our Moon is over four times that of the potato radius, over eighty times larger when cubed. Except for objects made of unobtanium, any object that is ~3500 kilometers across will inevitably be drawn into a spherical shape over time.