I'm not a housing expert - just someone who's been through the same sort of thing.
Our landlady gave us a scrap of paper asking us to leave in 6 weeks and post the keys through the door :o
Our housing officer said that this notice was not legal and would not stand up in court, and helped us write a letter to the landlady's solicitor - using all the right terms - to explain why the notice was not legal. It was scary us having to write to their solicitor, but in the end I'm glad because it made us feel like we had some control over the situation.
When they knew we'd got legal advice (which the housing officer is, just not a solicitor), they had to withdraw the notice and start again. that gave us breathing space to sort some things out ourselves, and get ready for any possible court action.
I have to say that Shelterline were also very, very helpful, and useful for checking the odd point with if the housing officer wasn't available.
Court action in itself won't affect your chances with the council or Housing Assoc - in fact councils will not usually pick up responsibility unless you have been through the court, as you still have a chance of remaining where you are - their preferred option.
The court will look at stuff like your willingness to pay any arrears, or make arrangements etc. they do not automatically take the side of the landlord.
The council and HA are more likely to look carefully at why you ended up homeless - i.e. was it your fault? Again, any attempts you made to rectify your situation, and your personal circumstances (i.e you had a temporary financial problem, which would have been resolved and you were not deliberately not paying rent) will also be considered.
But please, please don't take my word as gospel! Talk to both Shelterline (especially about rehousing by HA/council) and rely on your housing officer - they are often really good at what they do! :)