What merits a citation or coauthorship is a subtle question, but the answer doesn't change when people interact online. The main difference is that the interaction is more visible: authors may feel awkward if they decline to cite a publicly visible (but unimportant) contribution, and the contributor may feel encouraged to complain. This adds to the pressure of the decision, but it shouldn't change the answer, and the other issues and subtleties are the same as in offline interaction.
As for online contributions being "published", I suppose that's true in the technical sense that they have been made available to the public, but that's not what academics mean when they talk about publication. For example, listing a stackexchange answer as a publication on one's CV would be considered at least eccentric, if not deceptive, regardless of how impressive the answer was. (The best one could hope for is to list it somewhere else.)
I'm not sure what the relevance of the second paragraph of the question is, but here's a guess. Suppose Alice is writing a paper and Bob makes an absolutely critical intellectual contribution via a stackexchange answer. Normally such a contribution would merit coauthorship, but Alice might declare that Bob's work is already published via stackexchange and that she will simply cite it rather than making him an author. That would be unreasonable and unfair to Bob, but if Alice was scrupulous in citing Bob's answer and giving him full credit for its contents, then it's not clear that Bob would have any recourse. I'm not convinced this is more than a theoretical problem, since the number of stackexchange answers that could merit coauthorship is tiny (maybe not zero, but that's a good first approximation) and most authors are well behaved anyway. However, I suppose it could happen.