Can you fly a glider in a cloud on primary instruments?
With basic instruments (altimeter, speed and climb indicator and compass): Forget it!

A glider can enter a cloud when thermalling into it from below. Below the cloud the rising air was governed by dry adiabatic laws. Once it crosses into the cloud, the air is fully saturated and humidity starts to condense - after all, this is how clouds form. Now the rising air gets additional energy from condensation (its lapse rate goes down from the usual degree per 100 m of the dry adiabatic lapse rate to half a degree per 100 m) and the thermals inside the cloud become stronger. This is to say that turbulence will be more violent and the airplane will be tossed around. It will bank and pitch, and there is little chance that it will stay level for long. Since the spiral dive motion has very little damping, the glider will soon enter a spiral dive and overspeed.

The advice I got for the case that you are "sucked" into the cloud always was: Let go of the stick and open the speed brakes. Then wait until it gets light again.

In the 1930's some competition pilots tried to gain additional altitude by entering clouds. The results were catastrophic. In some cases the cover of the wings was torn to shreds by hail, and even bailing out would not be safe: One pilot froze to death when strong thermals inside the cloud lifted him to more than 8000m while he hung on his parachute.

I have done it once on a calm day when returning from the Alps. In the mountains the cloud base is higher, so it is entirely possible to arrive at the clouds over the alpine upland above their base height. I had a GPS on board that told me that I would reach the glider port safely when flying a straight line. It was late in the day, the thermals had died down and the clouds were fuzzy already, so little turbulence could be expected. One was in my way, and I went into it and flew out less than a minute later. The whole thing was completely uneventful, but I would not had done it with active thermals.