The answer is field dependent, in particular some fields in the humanities tend to consider "already published" what appeared even on a web page. Also, Glam magazines such as Nature and Science want to be able to keep the papers secret until they release them, possibly with communication toward the press. In mathematics, the most theoretical parts of computer science, and some of physics you can definitely put a preprint on the arXiv before submitting to a journal (there might be journals who don't enable this, but they would be a small minority). There is an excellent resource to determine the policy of a journal or publisher.
All of this could be gathered from previous comments. Now, the reason why I write this answer is to stress that for Elsevier, the default policy is that you can put your preprint on the arXiv and later update it according to referee's comment ("postprint" version), but you do not have the right to put the postprint on the arXiv between acceptance and 12 months after publication if the preprint was not there before. To avoid trouble you should thus put your preprint on the arXiv before acceptance (before submission being the easiest way).