The gas typically needs to be cleaned up at a nat gas processing plant.
Some have tried to make an economic means of using it directly but I have not seen a commercial success yet.
Keep in mind, if it was a significant amount of clean gas, it would already be piped in for economic recovery.
There are cogeneration plants associated with landfills. I’m sure that flare gas can be simply filtered enough to run in a generator.
Keep in mind that electricity is needed at the well site, and is either generated on site or power lines are brought in. Shipping out a limited amount of electricity is cheaper than piping out a limited amount of natural gas.