Actually this is already being done in Iceland.
"Geothermal energy is a major source of energy in Iceland, with about 25 percent of the country's electricity generated from tapping the Earth's heat, according to the National Energy Authority of Iceland. About 90 percent of Icelandic households are heated with geothermal energy."
Source: https://www.livescience.com/57833-scientists-drill-volcano-c....