Solution 1:

Smoke Rising

Smoking gives rise not only to smoke, but also to dreams and dreaming. The smoke may be from tobacco or opium, and the dreams inspired differ somewhat depending on which, certainly. Yet the dreams are dreams first, and opium or tobacco dreams second. Such 'smoke' dreams may stem from the euphoria and relaxation caused by smoking either substance, and may occur during sleep or during wakefulness.

In one of the first instances I could uncover where the association is made between smoking and dreaming, the substance smoked is not specified, and could be either tobacco or opium:

... I have mentioned the old family, who governed Mosul, of the Abdul Jelils. ... I paid a visit to the present representative of this race... who lives in the seat of his ancestors, ...no doubt, as he smoked his pipe, dreams of former greatness occasionally floated through his mind.

10 March 1847, London Daily News (paywalled link, italics mine), p 3.

Even earlier, however, comes an association with dreams where the substance, opium, is specified, but whether the opium was smoked or eaten is not declared:

Few women — I mean warm-hearted, high-souled women — have escaped the influence of these "opium dreams of too much youth and reading," as they are contemptuously called by the worldly and the cold.

The Baltimore Sun (Baltimore, Maryland; paywalled link) 19 Oct 1842, p 1.

In the first case, the dreams are not well-described as 'pipe dreams' according to the usual lexical definition. Such dreams are, rather, fond or comfortable recollections, relaxed musings on times past. In the second case, insofar as can be determined from the scanty relevant context, the dreams correspond with the usual lexical sense of 'pipe dreams'.

Setting the Phrase

pipe dream, n.
An unrealistic or fanciful hope or scheme; a ‘castle in the air’.

OED Online

The usual lexical sense of 'pipe dream' does not, however, preclude other uses, which are readily understood in context. As a set phrase, 'pipe dream' is

an expression whose meanings cannot be inferred from the meanings of the words that make it up.

WordNet 3.0

As a set phrase, a more comprehensive definition of 'pipe dream' in both contemporary and historical use would be

any fantastic, improbable, or otherwise unusual waking or sleeping dream, plan, theory, or idea, whether or not occasioned by narcotizing effects of smoking (tobacco, marijuana, opium).

'Pipe dream' is understood whether or not a literal pipe is involved; whether or not smoking is involved; whether or not literal dreams are involved. In each case, the meaning of the phrase "cannot be inferred from the meanings of the words that make it up".

So, in the case of the 1870 UK use of the set phrase 'pipe dream' in Tales of Life and Death, "The Fair Doe of Fernditch",

...perhaps the unwelcome conclusion to his last night's pipe-dream

alludes to an actual incident (the "unwelcome conclusion" mentioned as the end part of Hastings' 'pipe-dream'), wherein Hastings is kissed by the housekeeper; it also refers figuratively to a fantastic dream caused by smoking tobacco. Pipes, it is clear, do not themselves dream; neither was it the pipe that caused the dream. Rather, the source of the dream was first, the man smoking, and second, nicotine's narcotizing effects.

That the phrase is 'set', and means more than can be inferred from the meanings of the words, readily appears when the wording is changed. Thus, the phrasing "...perhaps the unwelcome conclusion to the dream he had when he fell asleep after smoking his pipe last night" does not convey the suggestion that the dream was caused by the pipe-smoking, nor does it convey that the dream was fantastic and improbable, nor yet does it convey that the fantastic and improbable elements of the dream were stimulated by the effects of smoking. Yet all these suggestions are conveyed by the set phrase 'pipe-dream'.

As a further illustration, a precursor phrase to 'pipe dream' is equally 'set' and, while it will still be understood as more than the sum of its parts, has not survived so well:

...people much given to whiskey are habitually visited by smoking dreams, which lead them to mistake one kind of spirits for another.

Ballyshannon Herald (Ireland; paywalled link, italics mine), 21 December 1860, p 2.

...to let Rome, in fact, be a howling wilderness to please an idle whim of a "united Italy." United in some Edwin James and Garbaldi cigar smoking dream! but in no other way, the South differing from the North as the Belfast Scotchmen differ from the Galway Celts!

Limerick Reporter (Ireland; paywalled link), 13 December 1861, p 1.

As with 'smoking dream' and 'pipe dream', so also the phrase 'pipe story' is set but, like 'smoking dream', has not survived as well as 'pipe dream'; OED Online provides an origin, some history, and a lexical definition in the list of compounds formed from 'pipe':

pipe story n. U.S. rare a fantastic or impossible story; cf. PIPE DREAM n.
1890 Chicago Tribune 26 Feb. 8/3 The story to the effect that ex-Senator Hill has fixed a deal with Senator Teller..is a fairy tale. We call it a ‘pipe story’ in the Wild West.
....

OED Online

The relationship between 'pipe dream' and 'pipe story' is evident; 'pipe story', however, has largely been supplanted by the set phrases 'tall tale' and 'tall story' in contemporary use, although 'pipe story' is readily understood even now (perhaps by analogy with its historical contemporary, 'pipe dream').

To sharpen the point with a bludgeon of further evidence, other early associations of smoking and dreaming include these:

...young men, chewing the weed and the cud of reflection, or dreaming, amid eddying curls of light blue smoke, "dreams that no dreaming mortals ever dreamed before."

Wilmington Daily Dispatch (Wilmington, North Carolina; paywalled link) 26 Jun 1867, p 3.

We have lately been told by a French publicist, M. Emile de Girardin, in a vein of sober earnestness, that the acts and policy of the Emperor are the outcome of his habit of smoking. "To smoke is to dream wide awake," it is asserted.

Edinburgh Evening Courant (Scotland; paywalled link), 14 December 1868, p 7.

Multiple associations of dreaming and smoking continue through 1885 in US sources:

Even the young man who sits lazily in his chair and dozes over his pipe, dreams of a maiden who appears above him, too fleshy for a real angel and too angelic to take offense at.

Salt Lake Evening Democrat (Salt Lake City, Utah; paywalled link), 03 Aug 1885, p 3.

In 1860 where was Grant? Inactive, sunk in indolence and tobacco dreams.

The Courier-Journal (Louisville, Kentucky; paywalled link, italics mine), 13 Sep 1885, p 14.

The Diaspora of Pipe Dream

The associations of smoking and dreaming, as well as the appearance of the phrases 'smoking dream' (Irish, 1860, 1861), 'pipe dream' (British, 1870) and 'tobacco dream' (US, 1885) lead to what OED recommends as a US origin in 1890 Chicago. The attestation given by OED,

1890 Chicago Tribune 11 Dec. ii. 9/3 It [sc. aerial navigation] has been regarded as a pipe-dream for a good many years.

should be supplemented with a second appearance, in another Chicago newspaper, on the same day in 1890:

It is worse than fighting Indians to listen to —
"All silent lies the village on the bosom of the vale,
So I'll squeeze another pipe dream, and grind out another tale."

The Inter Ocean (Chicago, Illinois; paywalled link), 11 Dec 1890, p. 6.

For my part, I recommend that the evidence, comprising as it does earlier appearances of the very similar (if not identical) set phrases 'smoking dream' and 'tobacco dream', along with the earlier appearance of 'pipe dream' itself, in Ireland, the US, and Britain respectively, argues for a spontaneous independent international origin owing more to the tendency of English, where ever it is spoken, to form nouns by a compounding process mortared by set phrases, than to use of the particular phrase spreading from one to another nation.

Solution 2:

The earliest Google Books pipe dreams

As Josh notes in his question, the earliest match for "pipe-dreams" in a Google Books search is from Grantley Berkeley, "The Fair Doe of Fernditch," in Tales of Life and Death, volume 1 (1870):

Among an infinity of sniffs, shrugs of shoulders, very audible sighs amounting to stifled groans, and tossings of the head, Mrs. Mantisser proceeded to render up the accounts, the housemaid who for the present to succeed her, having been ordered by Mr. Hastings, in a very feverish and peculiar manner, never to leave the room during the course of these proceedings, as if he had some reason or other for dreading a tête-à-tête, lively in his remembrance—perhaps the unwelcome conclusion to his last night's pipe-dream. [page 71]

But as StoneyB observes in a comment beneath the question, the story is quite clear that the "pipe-dream" in question were occasioned by Mr. Hastings's having smoked tobacco in a pipe prior to falling asleep:

'Your bit of nonsense! Why, cogs wounds! what does the woman mean? Whose been putting upon you? There, leave me, and I'll look into it tomorrow." So saying, Mr. Hastings sank into his easy chair, and commenced to stuff the bowl of his pipe with tobacco. [page 64]

...

"Ah that beautiful Fair Doe," sighed the smoker.—Puff, puff.—"Damn her impudence, that old housekeeper of mine; she's turned forty, and ought to know better. I keep a servant, not a mistress; leastways, so I will it, and she shall go! It don't do to let that class get the upper hand."—Puff, puff.—"I'll pension her off. She may go and prey on the human flock, not on me, and find if she can, a sky pilot, to fasten her talons on some fool forever."—Puff, puff, puff.—As he finished this sentence and with the last whiff of his pipe, very unlike his usual wont, which was to repair instantly to bed, he fell into a deep sleep,—deep all save his legs, which kept kicking about with the fidgets,—and shortly after he began to dream. [pages 65–66]

But the next-earliest Google Books match for "pipe-dream" is from a book published 21 years later in Chicago, Illinois—and the pipe involved in that pipe-dream is a Pan pipe. From James Blake, "Syrinx," in St. Solifer with Other Worthies and Unworthies (1891):

Pan dreamed of the pipe. The dream haunted him continually, and was to his spirit as the air he breathed was to his body. He had a dream of a wonderful music and voice which was to be made by a pipe, if only he could discover the pipe, or the wood of which it must be made, or the right shape and making of it.

So Syrinx, filled with the pipe-dream and the music, staid with Pan, looking about daily with as faithful eyes as his own. And the dream, and the search, and the wandering, which had been a sadness, now became a joy to Pan; for one pure sympathy and one brave heart, sharing his dream and believing in it, and rejoicing to see him in the light of it, was a wold of strength.

And the next Google Books match after that is from 1895, after the "opium pipe" sense of "pipe dream" was already established.


Early newspaper pipe dreams

Elephind and Library of Congress searches for "pipe dream" and "pipedream" yield a flurry of matches from late 1894 and throughout 1895.

The earliest match is from "Early Throes of Reform: The Seventy in a State Resembling Acute Colic," in the [New York] Sun (November 25, 1894):

"What are the nature of the charges against John C. Sheehan?"

"Well, I won't tell that, but they have to do with his proceedings on election day. The charges are strong and we can convict him, but heaven and earth will be moved to defeat us."

In the Second district around Chinatown they have a name for stories like this. They call them "pipe dreams."

...

These pipe dreams were not told to THE SUN reporter alone. They were circulated freely among the [Committee of] Seventy and the reformers.

The mention here of Chinatown (in lower Manhattan) is undoubtedly a reference to opium smoking, popularly associated with Chinese immigrants in New York, San Francisco, and elsewhere in the United States in the late nineteenth century.

The next match is again from the Sun, two days later, in "Col. Fellows Off to Albany" (November 27, 1894):

The reformers talked yesterday about a story that Col. Fellows would resign his office. If such a thing is possible this story is more foolish than the other pipe dreams. There is not a remote possibility of such a thing.

And the third is from the Sun in early 1895. From "Chimmie Fadden's Music Gale" (January 13, 1895):

"I was peepin' tru de curtain and I seed Miss Fannie and his Whiskers and Mr. Burton look at each odder like dey didn't know what t'ell; but Mr. Paul he looked up solemn as if dere wasn't a nodder small bet on eart'.

"Den de curtain was histed and I goes out feelin' like I was in a pipe dream and I sings de song.

Although the speaker here, Jimmy Fadden, has an Irish accent, he identifies himself as a "Bowery boy," which places him in New York City a few blocks away from Chinatown.

An interesting allusion the term occurs in an article originally published in the Chicago Tribune, and reprinted in the Rock Island [Illinois] Argus as "Fatality of a Name: A Strange Incident Which Suggests Mental Telepathy" (September 7, 1895):

Writers of fiction have no monopoly of the strange or supernatural. There are things taking place every day in Chicago which are as devoid of rational explanation as the mysterious coinings of the novelist's brain. Newspaper men hear of them, but in the rush for cold, hard facts, demanded both by city editors and newspaper readers, the "pipe stories," as queer and unexplainable happenings are called in journalistic circles, are at a discount. Were it not for this the following incident, which can be verified by the word of several reputable men, would long ago have received the space and attention it merits instead of being consigned to the wastebasket as the "pipe dream" of an opium devotee:


Early newspaper pipe stories

Matches for the term "pipe story" (in the sense of "fantastical story") go back somewhat farther than matches for "pipe dream"—but it isn't altogether clear whether the figurative pipe alluded to in the term was in those early days imagined to be filled with opium. From "Young but Tough: A Four-Year-Old Incorrigible Sent to the Reform School," in the St. Paul [Minnesota] Daily Globe (June 7, 1889):

The urchin will not live at home, and during the past year has been repeatedly picked up on the streets at night and kindly taken to some one of the stations for shelter. Then he would give a fictitious name, sometimes one and sometimes another, and tell a pitiful story of woe that not infrequently brought tears top the eyes of the good-natured coppers, who gathered around him. Sometimes he had been driven from home by heartless parents because he could not bring home pennies enough when sent out upon the street to beg. Another time his parents had died and left him without a relative or friend in the world, and he had wandered about the city for days, with only dry goods boxes to shelter him, and such food as he could pick up. And again he had been brought to the city and deserted by his parents at the union depot. ... But in the morning, or before, some one always put in an appearance at the station in search of him and the little romancer would be hustled away in disgrace. The police, however, finally got "onto" his pipe stories, in one station after another, and he was yesterday arrested and taken before the court. After hearing the case, Judge Burr decided that reform school was the best place for him, and referred him to the district court, with a recommendation to that effect.

And from the New York Sun (again) in a story titled "Big Faro Winnings: Stories of Heavy Playing by Enterprising Western Gamblers" (July 28, 1889):

"A hundred to one, bookmakers' odds, he didn't make that [$75,000] winnin'," said "One-armed" Schimmel.

John gave vent to this remark on reading what he called the pipe story. A small but select circle of experts in the green baize business sat around a table in the rear room of a Clark street saloon discussing Mr. Reschler's alleged phenomenal winning.

The expression became fairly widespread in the early 1890s, most notably in "Told a Pipe Story: Gordon Has Queer Fancies of a Conspiracy Against Him," in the St. Paul Daily Globe (again) (June 27, 1892):

The half crazed individual who said his name was George Gordon, arrested yesterday morning, is now in the county jail. Gordon, the city physician says, is either cray or under the influence of some narcotic. He related to the police yesterday a pipe story, about being pursued by a man who was endeavoring to poison him.

Also, from "Deluded to the Last: An Imaginative Gentleman Reads Bulletins to the Republicans," in the [New York] Sun (again) (November 9, 1892):

This man [reading telegrams to an assembled crowd at the Republican National Headquarters on election night] knew what he was laughing at. He confidentially called them "pipe stories." When he announced at 10 o'clock "Indian gives Harrison 30,000 plurality," the crown yelled itself hoarse.

The announcer got off his perch for a glass of water, and remarked to THE SUN reporter, "Gee, but that was a pipe story. I meant Pennsylvania." This man's mistakes were not responsible for all the "pipe stories." Most of them came down from the National Committee's room up stairs in the shape of bulletins.

And from the Omaha [Nebraska] Daily Bee (August 6, 1893):

A pipe story comes from Louisville that Bill Barnie has started south with $10,000 in "ready cash" to buy up good talent.


Conclusions

The Elephind and Library of Congress searches I ran did not turn up the 1890 instance cited by OED from the Chicago [Illinois] Daily Tribune. Instead, they yielded matches in which New York City was the earliest locale where "pipe dream" was in use as a slang term meaning fantasy—dating to 1894.

However, a possibly related term, "pipe story," was in use before 1894 in New York City; St. Paul, Minnesota; and Omaha, Nebraska. The earliest of these matches is from 1889 in St Paul. I couldn't find any decisive evidence that "pipe story" in its earliest occurrences alluded to an opium pipe (as opposed to a plain tobacco pipe, such as one might smoke while sitting with others and swapping tales), although the June 27, 1892, St. Paul Daily Globe story does tie the term to a person whom it describes as either insane or drugged.

For its part, "pipe dream" is associated with opium smoking from the outset of the newspaper matches I found (November 25, 1894). From the evidence I have on hand, it seems likely that both expressions are of U.S. origin and possible (but by no means certain) that "pipe story" influenced the emergence of "pipe dream," since the two terms have similar meanings.

As for the 1870 instance of "pipe-dream" from Great Britain involving a tobacco pipe smoker, I see no evidence that this occurrence of the wording was anything but coincidental. Database searches do not yield any additional instances of the term over the next twenty years anywhere—and when matches do begin to appear in the 1890s, they do so first in the United States and only later (and rarely) in the 1890s in the UK.

A search of the British Newspaper Archive yields one match from the London Morning Post (October 24, 1861) involving something that (I gather) is described as being "like an opium-pipe dream"—but that instance seemingly involves a simile rather than an idiomatic term. (I don't have a subscription to this website and so cannot confirm the wording or elaborate on the context of the rather garbled language that appears on the search page that I linked to earlier.)

The next-earliest matches for "pipe dream" from the same British database are from 1896 and 1899. Of these, the most interesting is this one, from the Dublin Daily Nation (September 28, 1899):

Nationalists have been thinking that yourself and your co-secretaries have been rather indulging in what our Yankee friends call "pipe dreams," over the matter.

It thus appears that, in the late 1800s, at least one Irish reporter or parliamentarian (the context of the extract suggests the latter) considered "pipe dream" to be a U.S. English idiom.

Solution 3:

From Successful Advertising, How to Accomplish It: A Practical Work for Advertisers and Business Men (1902):


'Mr. R. Nete Ellis, of St. Joseph, Mo., also used for advertising his cigar store one of his bright ideas called a " Pipe Dream." He had made out of half-inch lumber a wedge-shaped box 5 feet long, the ends of which were 6x6 and 15 X 15 inches respectively. The small end had a peep-hole of about 1½ inches in diameter and the other end a mirror, which made it look a mile long. The inside of the box was painted jet black. A twenty-four candle-power incandescent light about a foot from the larger end, and suspended from the lid, furnished the light.

The outside of the box was painted white to match the woodwork in the windows. He suspended the box in the window by means of wire from the ceiling, allowing the smaller end to rest against the window glass just high enough to admit a straight view through the peep-hole. A card over the box and against the window pane bore the words, "Look Here ; A Pipe Dream ! ' ' The inside of the box was nicely arranged with nice pipes, French briars and meerschaums, the centerpiece in the rear being a handsomely carved meerschaum pipe in case, bearing its price, $15-00. He fastened pipes to the sides by means of hooks screwed in the walls, fastening the pipes to them by means of rubber bands. A few cans of choice smoking mixtures finished the display. The "Pipe Dream" furnished something to attract passers-by; and every hour in the day crowds were seen standing in front of the store viewing the " Pipe Dream," or else were heard asking people whether they had seen the " Pipe Dream " at the Nete Cigar Store. '


This can be one of the origins : specially when the book in question is merely giving facts about advertising. The writing does not seem to imply that the author is in any way aware of "pipe dream" being an idiom.

Also why would the cigar shop owner in excerpt above call his ad a 'pipe dream' if there existed a similar expression alluding to an 'improbable fantasy' -unless the connotation of this idiom was different back then.

St. Joseph, Mo being in the US , this would to be an Americanism, if such were indeed the origins.

Solution 4:

Etymologically and historically speaking, I think it comes from British English.

Your etymonline explanation omitted the last explanation offered, where the site likened "pipe dream" to the Old English word pipdream meaning "piping." Furthermore, en.wiktionary.org categorized pipe dream as an English idiom. There are several sources that do state that this is an Americanism, such as the ones you cited, but we also have to consider the history behind the situation. The British were among the first to bring back Chinese opium and the first to begin its use. Though the Portuguese had some limited contact with the drug (which I must again emphasize is clearly connected to pipedream), the English were trading it since 1773, a time when America wasn't even a thing! This longer time of exposure to the same hallucinogenic drug gave the English more opportunities to name the pipedream, while Americans only really had a brief stint with opium in the late nineteenth century. Pipe dream is clearly a combination of pipe + dream, but how long ago was this connection made? Maybe it really traces back to Old English and pipdream, but was in such scarce or informal use that pipe dream only became availiable to etymologists in that example in Chicago.

So, it's only a theory, and due to the uncertain nature of linguistics, we'll never know for sure, but there is etymological evidence as well as overwhelming historical opportunity that pipe dream in fact is not an Americanism after all.