The Parable of the Good Samaritan is precipitated by and in answer to a question posed to Jesus by a lawyer. In this case the lawyer would have been an expert in the Mosaic Law and not a court lawyer of today. The lawyer's question was, "Teacher, what shall I do to inherit eternal life?" (Luke 10:25). This question provided Jesus with an opportunity to define what His disciples' relationship should be to their neighbors.
You may be confusing two different things. There was the parable of the Good Samaritan (Luke 10:25-37) who PROVIDED help to an injured man whom, socially, he was supposed to despise. Then there was the true incident of Christ providing spiritual assistance to a samaritan woman at a well when jews were supposed to despise and shun all Samaritans. (John 4:4-26).