Jesus never declared all foods clean. Although Polyhat and Anne did a great job answering the question, I would like to add a couple of things.
The problem in Mark 7:1-23 and Matthew 15:1-20 is not Torah based ritual purity. It is the traditions of the elders. The handwashing discussed in the chapter is still practised by Jews today, and it is called netilat yadayim in Hebrew.
“The tradition of netilat yadayim prior to eating bread originated with the rabbis of the Talmud . It derives from various practices concerning ritual impurity from when the ancient Temple stood in Jerusalem. The priests who performed the temple rituals were given gifts of oil, wine and wheat that could be eaten only after ritual washing. For various reasons, the ancient rabbis extended this practice to all Jews before eating meals. Some sources suggest that the practice was instituted so the Temple’s washing ritual would not be forgotten.
Whatever the reason, the practice, incumbent upon both men and women, was established by talmudic times and later included in the medieval codes of Jewish law.
Some passages in the Talmud indicate that failing to wash hands before a meal is a significant transgression. One talmudic sage even says that eating bread without washing is tantamount to having sex with a prostitute, while another says that acting contemptuously toward this ritual causes one to be uprooted from the world.” https://www.myjewishlearning.com/article/hand-washing/
So the verse “in saying this, Jesus declared all foods clean” applies not to uncleanness according to the book of Leviticus but to man-made rabbinical traditions. Jesus's point was that none of the things rabbis introduced make one unclean.
As for Peter's vision it is all based on the Book of Enoch. The so called “Animal Apocalypse” (chapters 83-90). Peter also quoted from it in his second letter. Peter must have loved that book, since God used it to show him something.
3. ...I saw in a vision on my bed, and behold a bull came forth from the earth, and that bull was white (Adam); and after it came forth a heifer (Eve), and along with this (latter) came forth two bulls, one of them black (Cain) and the other red (Abel).
4. And that black bull gored the red one and pursued him over the earth, and thereupon I could no longer see that red bull.
The Book of Enoch 85
9. But that white bull which had become a man (Noah) came out of that vessel, and the three bulls with him, and one of those three was white like that bull (Shem), and one of them was red as blood, and one black: and that white bull departed from them.
10. And they began to bring forth beasts of the field and birds, so that there arose different genera: lions, tigers, wolves, dogs, hyenas, wild boars, foxes, squirrels, swine, falcons, vultures, kites, eagles, and ravens; and among them was born a white bull (Abraham).
11. And they began to bite one another; but that white bull which was born amongst them begat a wild ass (Ishmael) and a white bull (Isaac) with it, and the wild asses multiplied.
12. But that bull which was born from him begat a black wild boar (Esau) and a white sheep (Jacob); and the former begat many boars, but that sheep begat twelve sheep.
13. And when those twelve sheep had grown, they gave up one of them to the asses, and those asses again gave up that sheep to the wolves, and that sheep grew up among the wolves.
14. And the Lord brought the eleven sheep to live with it and to pasture with it among the wolves: and they multiplied and became many flocks of sheep.
15. And the wolves began to fear them, and they oppressed them until they destroyed their little ones, and they cast their young into a river of much water: but those sheep began to cry aloud on account of their little ones, and to complain unto their Lord.
16. And a sheep which had been saved from the wolves (Moses) fled and escaped to the wild asses; and I saw the sheep how they lamented and cried, and besought their Lord with all their might, till that Lord of the sheep descended at the voice of the sheep from a lofty abode, and came to them and pastured them.
17. And He called that sheep which had escaped the wolves, and spake with it concerning the wolves that it should admonish them not to touch the sheep.
The Book of Enoch 89
It goes like this through all the history of Israel. And this is how the story ends:
37. And I saw that a white bull was born, with large horns and all the beasts of the field and all the birds of the air feared him and made petition to him all the time.
38. And I saw till all their generations were transformed, and they all became white bulls; and the first among them became a lamb, and that lamb became a great animal and had great black horns on its head; and the Lord of the sheep rejoiced over it and over all the oxen.
The Book of Enoch 90
So God used Peter's hunger and a story that depicted humans as all sorts of animals (clean and unclean) to show the apostle that in the end He makes everyone clean in Messiah.