He said to her, "Let the children be fed first. For it is not right to take the food of the children and throw it to the dogs." She replied and said to him, "Lord, even the dogs under the table eat the children's scraps." Then he said to her, "For saying this, you may go. The demon has gone out of your daughter." Mk 7, 27-29
The woman was desperate. She had an urgent need of help. Her daughter was demon possessed. Demons do not have any territorial restrictions. They possess people of any religion, any region, any sex, any age etc.
If so, why Jesus makes this distinction. The author of the Gospel of Mark wants to communicate something through this miracle. Because , later on, Jesus tells his disciples to go the ends of the earth to proclaim the kingdom and to cast out demons etc.(Mk 16, 14-17)
This miracle story has an odd exchange of words between Jesus and the woman. May be through this exchange of words the author wants to communicate something. Jews often thought of Gentiles as dogs. It was intended to be an apparent insult. Because dog returns to its own vomit (2 Pet 2,22) The context of this verse says that, the people who are compared to dogs are those, who after knowing Jesus return to worshiping their earlier Gods. Does Mark, the author, wants to say that anyone who comes in contact with Jesus should remain faithful to him? If not they are like dog that return to its vomit. Or is it a warning to this lady that she should not return back to her old belief after receiving the miracle? Could be.
Her reply proves that she was faithful to Jesus and Jesus also accepts her response by performing the miracle.
So belief in Jesus and following Jesus are stressed.