"Main stream", as two words, used in a figurative sense, goes back to 1921, at least:
An English Anthology of Prose and Poetry, Shewing the Main Stream of
English Literature Through Six Centuries
Around 1960, "mainstream" took over from "main stream":
(While uses of "main stream" prior to about 1920 tended to be in the literal river sense, few after that time were.)
It is a natural metaphor, and does not appear to have been strongly associated with any particular political/social movement -- I find uses with science, religion, economics, music, art, literature, et al. And the term has a special meaning in education, where "mainstreaming" refers to placing a "special needs" student in "normal" classes, to the extent possible.
"Mainstream media" didn't really take off until the mid 80s, though Ngram does find one pejorative use in 1958. It's hard to categorize the uses of this term -- it was not often used in the hard-right pejorative sense until the late 90s, but earlier uses were often associated with criticisms of the coverage of women's rights and racial equality issues.
The OED attributes haptic and haptics to translations of a passage in Isaac Barrow's 1683 Lectiones Mathematicae,
Quod si perinde comperta foret undulationis aereae figura, qua sonus efficitur, et audiendi sensus impellitur, inde nova proculdubio pars emergeret Matheses, Acoustices nomine celebranda.
Haptice quoque, et Geustice, et Osphrantice pari jure mererenur in hunc ordinem cooptari; si cujusmodi motibus peraguntur istae sensiones conjectura subodorari possent philosophantes.
The first citation of haptic in the OED is from 1860, in William Whewell's edition, and the first of haptics in an earlier translation published in 1734 by John Kirby:
But neither term saw much light of day, and it is more probably more accurate to say that it was introduced from the world of psychology in the late 19th century, the OED's second suggestion. Specifically, it appears the 1892 Über den Hautsinn by Max Dessoir, coined as a parallel to acoustics and optics:
Ich erlaube mir, hierfür das Wort „Haptik" in Vorschlag zu bringen, das im Anschluss an Optik und Akustik gebildet und von dem Verbum ἁπτομαι abzuleiten ist.
or loosely,
I take the liberty to bring forward the word haptics in proposal, which follows optics and acoustics and is derived from the verb ἁπτομαι.
I imagine Dessoir wanted a term of Greek origin, hence haptics over, say, tactilics. Haptic as an adjective is cited from 1895 onwards, with the first post-Dessoir citation given from Mind 4:407:
In haptic sensations are recognised sensations of simple pleasure, of traction and of impact.
Until the term was applied to touchscreen technology, the psychological term seems to have been the principle use, hence the International Society for Haptics.
Best Answer
The phrase "coming out" has a fairly rich history of figurative usage stretching back to at least 1637. My answer focuses on three senses of term, in order from oldest to youngest: "making an appearance," "entering society," and "publicly avowing one's homosexuality."
'Coming out' as 'making an appearance'
J.S. Farmer & W.E. Henley, Slang & Its Analogues (1891) has this first definition of "come out":
Farmer & Henley then lists two examples, both involving the form "coming out," although the authors warn that "The first quot. is doubtful, but it looks like an anticipation." Here are the fuller versions of those two citations. From Samuel Rutherford, letter to "my Lady Boyd" (May 1, 1637), in Joshua Redivivus, or Mr Rutherford's Letters (1765):
And from William Thackeray, The Newcomes: Memoirs of a Most Respectable Family (1855):
'Coming out' as 'entering society'
The earliest dictionary notice of "coming out" in the sense of "entering society" that I have found is in John Bartlett, Dictionary of Americanisms, fourth edition (1877), where it appears as the third definition in the entry for "To come out." All three definitions are worth repeating here, however:
Bartlett only slightly alters the quotation from Jeanie Gould, Marjorie's Quest (Boston, 1872). Here is the original example:
This definition of "to come out" is new to the fourth edition of Bartlett; the third edition (1860) lists only the first two definitions.
A Google Books search turns up an even earlier instance of "coming out" in the social sense of the phrase in a novel published in London in 1835—with the difference that the person coming out is male. From James Payn, From Exile (1835):
And soon after Payn, another book published in London took up the female side of coming out. From Eliza Farrar, The Young Lady's Friend; A Manual of Practical Advice and Instruction to Young Females on Their Entering upon the Duties of Life, After Quitting School (1837)
Mrs. Lincoln Phelps, Hours with My Pupils: Or, Educational Addresses, Etc. (New York, 1859) devotes considerable space in "Address II: Dignity of Character" (originally delivered in 1842) to the subject of coming out:
But as interesting as the debutante meaning of "coming out" is, use of the term to describe a religious enthusiast's open profession of faith is even more striking (to me) as an antecedent for the much later gay sense of "coming out." That sense of the phrase appears as early as the second edition of Bartlett (1859), with further details in the associated entry for come-outers, which first appeared in the first edition of Bartlett (1848):
The religious sense of "coming out" is absent from Farmer & Henley, however, so it may have dropped out of use (and memory) by the end of the nineteenth century.
'Coming out' as 'publicly avowing one's homosexuality'
J.E. Lighter, Random House Historical Dictionary of American Slang (1994) has this entry for "come out":
The earliest instance that a Google Books search finds of "coming out" used in connection with an open profession of one's homosexuality is in Erving Goffman, "The Moral Career of the Mental Patient" (1958), reprinted in Goffman's Asylums: Essays on the Social Situation of Mental Patients and Other Inmates (1961). Goffman begins by describing the acclimation of recently arrived patients to life at a mental hospital:
Then, in the accompanying footnote 28, Goffman describes one of the "other groupings" he has in mind:
Conclusions
"Coming out" has been used figuratively to mean "making an appearance or displaying oneself" for centuries. The example from 1637, cited in Farmer & Henley, Slang & Its Analogues, seems legitimate to me, though the authors of that dictionary say rather that "it looks like an anticipation."
"Coming out" in the sense of "entering society" goes back to 1835 (with reference to a young man in England), to 1837 (with reference to young women in England), and to 1842 (with reference to young women in the United States) in Google Books searches. A now-obsolete use of the phrase—at least in the infinitive form "come out," to mean "make an open profession of religion"—was current by 1848, according to the first edition of Bartlett, Dictionary of Americanisms.
And finally, "coming out" in the sense of "presenting oneself openly (at least in some settings) as homosexual" is documented as far back as 1941 (in Lighter, Random House Historical Dictionary of American Slang) and 1958 (in Google Books search results).
As to the specific question, "Was the 'the debut in society' the origin of its usage [with reference to homosexuality]?" you could certainly make a strong argument that the two are directly connected. But other possibilities exist as well, and at least one other use of "coming out" was gaining steam during the 1930s—the decade prior to the first citation in Lighter: "coming out of [one's] shell."
A Google Books search for "coming out of his shell" finds one match from 1903 (from Bernard Shaw's Man and Superman), another from 1930 (from Gordon Stowell, The History of Button Hill), another from 1931 (from L'École Canadienne, Revue Pedagogique), and another from 1933 (from Richard Hatch, Leave the Salt Earth)—all in the sense of "emerging from self-imposed (and perhaps self-protective) isolation."
One phrase that seems to have emerged too late to take credit as the source of "coming out" is the longer wording "coming out of the closet." The first Google Books match for this phrase is from Douglas Stange, Metanoia, volumes 2–8 (1970[?]):
J.E. Lighter gives a first citation for "come out of the closet" of 1971, and a first citation for "in the closet" and "closet queen"—both from Mart Crowley's play, The Boys in the Band—of 1967.
Historically "coming out" has been used idiomatically to refer to a number of ideas associated with taking one's place openly and visibly in the world. It may be that multiple senses of the phrase influenced the emergence of the phrase in a specifically gay milieu. But because homosexuality was such a taboo in the United States and other English-speaking countries, particular terms may have evolved underground (as it were) over an unknown number of years, and that evolution in the shadows may make tracing the origins of gay terminology unusually difficult.