Is it possible to generate energy using gravity?
Yes and no. It depends what you mean by generate. What gravity does, is convert energy from one form to another. When you lift a bucket of water you do work on it. You add energy to it - we call it potential energy. Then when you upend the bucket, the water pours out, and gravity converts potential energy into kinetic energy. This can drive a turbine and generate electricity.
We commonly talk of electricity as energy, so "gravity has generated energy". But it hasn't created any energy, or added any energy. Conservation of energy applies. It's merely converted potential energy into kinetic energy. In the world at large the input energy comes from the Sun which evaporates the water. It lifts it up and does work on it, like you did with the bucket.