Special airplanes and specially equipped helicopters ARE used to fight fires, mainly forest fires.
In parts of Europe, where I live, the name "Canadair" was synonym with the special firefighting planes, such as Canadair CL-215 and Canadair CL-415. Through my youth I was convinced that Canadair manufactures only firefighting planes, and only later I found out that they make passenger planes as well.
So the answer to that part is, they are used.
As to why they are (mostly) not used in urban environments, the answer is, there are better ways to prevent and fight fires in urban environments, so the need for a firefighting aircraft in urban areas is very infrequent. In properly maintained urban buildings you have fire alarms, sprinklers, and good access for the fire engines - while in the remote forests you have no such things.
Forest fires in southern Europe are quite regular and predictable occasion (due to tourists/visitors, sparks from the railways, etc.) so you can be sure that the fleet of firefighting aircraft in any country will be engaged for large part of the summer (and when not in use, they will be sent to help to their neighboring countries to help).
As people already explained, maintenance of these aircraft is costly and you cannot expect them to be sitting ready on the tarmac in London (for example) for 10 years without any engagement, until a fire breaks out in the building that was refurbished with flammable materials in what it seems now a criminal negligence. They also need time to be loaded with water (and perhaps chemicals, depending on the nature of the fire). When fighting fires in the wild (forests) they are never used alone (or even as first response), but always in combination with firefighters on the ground, if the terrain is difficult to access.
So, sadly, while a fully loaded Canadair CL-415 sitting on the tarmac with pilots ready for action 24/7 would perhaps help in Grenfell tower fire, having such aircraft ready 24/7 in urban environments simply does not pay off. And if it would not have been ready 24/7 it could not make any difference, since with Grenfell, the building was engulfed with flames within half an hour, if I remember correctly.
Of course, the issue of flying low in the city during the night over the fire also poses far greater risk than flying over a remote burning forest with accurately mapped topography (elevation).