One thing that one encounters readily in examining the gospel traditions is that a saying or aphorism may have very different applications or settings in one gospel to the next. Consider the passage in Mark 7:27 in which Jesus is portrayed as calling the Syrophoenician woman a "dog":
"Let the children first be fed, for it is not right to take the children's bread (arton) and throw (balein) it to the dogs (kunariois)" (Mark 7:27).
Literally, the term is "puppies" (kunariois), obviously meant to parallel the "children" (teknón). Now, this logion is a version of the aphorism attested outside of Mark in Matthew, the Gospel of Thomas, and the Didache:
"Do not give dogs (kusin) what is holy (hagion), and do not throw (baléte) your pearls before swine, lest they trample them underfoot and turn to attack you" (Matthew 7:6).
"Do not give what is holy to dogs, lest they throw them on the dung heap. Do not throw the pearls to swine, lest they grind them to bits" (Gospel of Thomas 93:1-2).
"But let none eat and drink of your Eucharist except those who have been baptised in the Lord's name. For concerning this also did the Lord say, 'Do not give what is holy to the dogs' " (Didache 9:5).
The simple aphorism which is open to interpretation is applied in different ways in different texts. In the Gospel of Thomas there is no application given, while the context in Matthew suggests that "hypocrites" are in view, those who find fault with others while being ignorant of their own flaws (cf. 7:4-5), and who do not do the will of God despite their piety (7:13-32). In the Didache, the saying is applied to unbaptised persons receiving the Eucharist (= "bread"). Tertullian cited the saying in reference to the giving of baptism (De baptismo, 18.1), the Naassenes used it to refer to sexual intercourse (Hippolytus, Refutatio haeresium, 5.8.33), and both the Gnostics and orthodox Christians applied it to advanced teaching (cf. Hippolytus, Refutatio 9.17.1; Clement of Alexandria, Stromateis 1.55.3, 2.7.4; Origen, Homily on Joshua 21.2; Tertullian, De praescriptione 26, 41). Jesuine sayings were liable to wide application to different settings, and were often used to construct narratives intended to situate the saying into a story; sometimes miracle narratives were even based on parables or aphorisms (see for instance [1]). The story in Mark 7:27 may in parallel to other examples represent an attempt by the Markan author to provide a Sitz im Leben for the aphorism about giving holy things to dogs, by envisioning an interaction between Jesus and a Gentile woman, thereby interpreting the proper recipient vs. dog constrast as Jews vs. Gentiles, rather than baptised vs. unbaptised (as in the Didache), righteous vs. hypocrites (as in Matthew), initiated vs. uninitiated (as in other texts), etc. The Eucharistic interpretation found in the Didache builds on the aphorism in the direction of the Markan version, for it construes what is given to dogs as Eucharistic "bread", the very metaphor that Mark uses in his version. This metaphor, moreover, allows the wry retort of the woman by pointing out that bread produces crumbs so that both children and dogs may feed at the same time. The alteration of "dogs" to "puppies" in Mark is also accounted for by designating the proper recipient as "children", making "puppies" the canine equivalent.
Thus we can see that gospel traditions were pliable and a saying can be used to construct a story intended to provide a setting for the saying, and the deviations from the aphorism found in Mark are explainable in predictable ways.