I was in a similar discussion to this not long ago, and someone cited the fact that posted prices for spellcasting services in 3rd Edition was clear evidence that one could acquire magic for gold. There was an older player who argued mightily that such a thing was a modern contrivance and that spellcasters would ("never") barter their magic for money. I mean, the argument is absurd on the face of it, scribing spells, having backup spellbooks, enchanting items, and magical research has always cost money- being a Wizard is not a cheap profession.
But carefully reading the 1e DMG, on pages 103-104, sure enough, Gary has provided gp values for spells. Some of these are pretty significant, of course, and a few examples are for very short duration spells (I can only assume Bless is on the list in case you have to fight a Rakshasa), but the examples are here. Of course, Gary is careful to note that these prices generally require you to A) go find the home of the caster in question, and B) have a similar alignment (in the case of bartering for priest spells). He prefaces this list with an example of a Fighter having to track down a Wizard in a city, so there is a "plot tax" involved. Food for thought, regardless.
As to how common spellcasters are, that is somewhat setting dependent. Mystara and the Forgotten Realms have many spellcasters, and of quite high level present in the campaign (indeed, just flipping through Forgotten Realms Adventures, the amount of individuals with class levels is astoundingly high (I vaguely recall somewhere seeing the daughter of an Innkeep being presented as a 2nd level Fighter, despite still being a tween or young teen!). Greyhawk has it's casters organized into secret societies. Krynn has one such society, and casters who do not belong to it are apparently hunted down as renegades! Some campaigns support schools of wizardry with reasonably sized student populations (I guess all those 1st level M-U adventurers have to come from somewhere!).
However, only Eberron attempts to justify the impact a large amount of casters have on the setting in a player-facing way (and indeed, high-level spellcasters are rare, even there). Others have the reality be unknown to most people, such as Ed Greenwood's "magical cold war", where floating cities and airships exist, but the secrets of their construction are held by a small percentage of the populace.
Individual adventures, over the years, however, have made magical advancements appear with regularity, but the impacts on the settings they are found in are kept small regardless. Sure, maybe there was a magic steamboat in one adventure, but somehow it never becomes a thing.
A good example as to why is illustrated in an old Dungeon adventure. A scribe, annoyed by how hard his job was, had a stroke of genius and invented a fountain pen. He is found dead, stabbed in the heart with said pen! The players eventually solve the murder, finding out it was done at the behest of the scribe's guild, as this new technology would put them out of business!
So think carefully before creating a magic steam boiler or printing press! There are wealthy, organized people out there who have a vested interest in maintaining the status quo...