There are a lot of websites like bookrix.com and inkpop.com (run by HarperCollins) that allow you to submit and "publish" your creative work online. Does this count as publishing work?
Only if you get paid. In actual money.
(Some contests require that you only submit unpublished works). Also, do you retain copyright on the stories you submit?
If it is a legitimate, paying online source, they will ask to retain the copyright for a certain amount of time (usually a year or two), after which rights revert back to you. If you don't know their policy, ask.
Does publishing yourself online adversely affect your chances of being published legitimately?
No. But it might not do anything good, either.