Jesus was trying to allow His disciples a chance to rest at the time.
Matthew 15:21 says this "Leaving that place, Jesus withdrew to the region of Tyre and Sidon." He was withdrawing to allow his disciples to rest, as they were missing meals and becoming very burdened with the workload.
The parallel in Mark's gospel (
Mark 7:24-29) comes after Jesus' ministry to his disciples was interrupted in
Mark 6:30-34:
30 The apostles gathered around Jesus and reported to him all they had done and taught.
31 Then, because so many people were coming and going that
they did not even have a chance to eat, he said to them, "
Come with me by yourselves to a quiet place and get some rest."
32 So they went away by themselves in a boat to a solitary place.
33 But many who saw them leaving recognized them and ran on foot from all the towns and got there ahead of them.
34 When Jesus landed and saw a large crowd, he had compassion on them, because they were like sheep without a shepherd. So he began teaching them many things.
And again, in
Mark 6:53-56:
53 When they had crossed over, they landed at Gennesaret and anchored there.
54 As soon as they got out of the boat, people recognized Jesus.
55 They ran throughout that whole region and carried the sick on mats to wherever they heard he was.
56 And wherever he went—into villages, towns or countryside—they placed the sick in the marketplaces. They begged him to let them touch even the edge of his cloak, and all who touched him were healed.
As you can see, they had been
extremely overworked up to this moment,
even missing meals, and Jesus was trying to find a way for them to rest.
Jesus tried dismissing the woman, but as Jacob who refused to let go of
[some say an angel, some say God the Son in the form of a man] until he was blessed (see
Genesis 32:22-32 for that epic battle), the woman wouldn't take no for an answer. Her faith was shining, and Jesus, after seeing this display of great faith, decided that she was worth the loss of rest that his disciples had to endure.
So, in conclusion and summary, Jesus was trying to carry out his duties when he was interrupted, then tried to send the woman away for the sake of his disciples, then was shown an act of great faith by the woman, and couldn't refuse her request any longer.
Oh, and the comparison with dogs meant as in a pet, which are usually tended to by children, as in the
children (disciples) teaching the
dogs (gentiles; it wasn't intended to be an insult, it was used only to serve the analogy) what they had learned from their
Parent (Jesus).