If they haven’t yet offered you a job, then an employer is within their rights to consider information from your Facebook profile when making a decision. It’s bad HR practice though for any employer that claims to support equal opportunities in recruitment, as it doesn’t make for a level playing field if they know more about some candidates than others.
Employers are not allowed to discriminate against you in terms of age, gender, sexuality, ethnicity, disability, religion or belief, or union membership, all of which they could potentially find out if you or your friends discuss it online. Making a case against an employer for this is very hard though, as you need to prove their decision was based on discrimination rather than you not being the best person for the job.