The question relates to this incident in Genesis 18:
18 1 And the Lord appeared to him by the oaks of Mamre, as he sat at the door of his tent in the heat of the day. 2 He lifted up his eyes and looked, and behold, three men were standing in front of him. When he saw them, he ran from the tent door to meet them and bowed himself to the earth 3 and said, “O Lord, if I have found favour in your sight, do not pass by your servant. 4 Let a little water be brought, and wash your feet, and rest yourselves under the tree, 5 while I bring a morsel of bread, that you may refresh yourselves, and after that you may pass on—since you have come to your servant.” So they said, “Do as you have said.” … 10 The Lord said, “I will surely return to you about this time next year, and Sarah your wife shall have a son.” And Sarah was listening at the tent door behind him. … 16 Then the men set out from there, and they looked down toward Sodom. And Abraham went with them to set them on their way. 17 The Lord said, “Shall I hide from Abraham what I am about to do, 18 seeing that Abraham shall surely become a great and mighty nation, and all the nations of the earth shall be blessed in him? 19 For I have chosen him, that he may command his children and his household after him to keep the way of the Lord by doing righteousness and justice, so that the Lord may bring to Abraham what he has promised him.” 20 Then the Lord said, “Because the outcry against Sodom and Gomorrah is great and their sin is very grave, 21 I will go down to see whether they have done altogether according to the outcry that has come to me. And if not, I will know.” 22 So the men turned from there and went toward Sodom, but Abraham still stood before the Lord. 23 Then Abraham drew near and said, “Will you indeed sweep away the righteous with the wicked? … 32 Then he said, “Oh let not the Lord be angry, and I will speak again but this once. Suppose ten are found there.” He answered, “For the sake of ten I will not destroy it.” 33 And the Lord went his way, when he had finished speaking to Abraham, and Abraham returned to his place.
So we see three angels appearing one of whom is what is called “the LORD”, as distinct from “the angel of the LORD” used 53 times in the Old Testament.
Exodus 33:20-23, John1:18 and 1 Timothy 6:16 – among other verses – make it clear that no man can see God and live, and that no man has ever seen God, so the LORD here is an angel.
20 But,” he said, “you cannot see my face, for man shall not see me and live.” 21 And the Lord said, “Behold, there is a place by me where you shall stand on the rock, 22 and while my glory passes by I will put you in a cleft of the rock, and I will cover you with my hand until I have passed by. 23 Then I will take away my hand, and you shall see my back, but my face shall not be seen.” (Exodus 33:20-23)
But why then is the angel who spoke to Abraham called “the LORD”?
The LORD here is Yahweh, the covenant name for God rendered by Lord in the New Testament. So basically the angel here is being called ‘God’.
This is not common in the Old Testament but does happen occasionally in encounters with angels. In Exodus 3:2–6 “the angel of Yahweh” (מלאך יהוה) appears to Moses in the burning bush, but then the text switches and “Yahweh” (יהוה) says to Moses: “I am the God of your father”.
Compare also Judges 6:11–22 where the “angel of Yahweh” switches to “Yahweh says” in the call of Gideon:
11 Now the angel of the Lord came and sat under the terebinth at Ophrah, which belonged to Joash the Abiezrite, while his son Gideon was beating out wheat in the winepress to hide it from the Midianites. 12 And the angel of the Lord appeared to him and said to him, “The Lord is with you, O mighty man of valour.” 13 And Gideon said to him, “Please, my lord, if the Lord is with us, why then has all this happened to us? And where are all his wonderful deeds that our fathers recounted to us, saying, ‘Did not the Lord bring us up from Egypt?’ But now the Lord has forsaken us and given us into the hand of Midian.” 14 And the Lord (Yahweh, יהוה) turned to him and said, “Go in this might of yours and save Israel from the hand of Midian; do not I send you?” (Judges 6:11-14)
Theophanies – manifestations of God
It is what is sometimes called theophanies (from the Greek phanerosis, manifestation, appearance), so literally the old term “God manifestation”, or in more natural English, “manifestation of God”. In Genesis 18 this theophany means an angel showing God rather than simply an angel delivering a message in a role equivalent to a messenger. Angels are only one way in which God may appear in the Old Testament – other incidents include the burning bush (though this is stated to be an angel), the pillar of fire and the pillar of cloud.
Another famous incident is Jacob wrestling with God:
25 When the man saw that he did not prevail against Jacob, he touched his hip socket, and Jacob’s hip was put out of joint as he wrestled with him. 26 Then he said, “Let me go, for the day has broken.” But Jacob said, “I will not let you go unless you bless me.” 27 And he said to him, “What is your name?” And he said, “Jacob.” 28 Then he said, “Your name shall no longer be called Jacob, but Israel, for you have striven with God and with men, and have prevailed.” 29 Then Jacob asked him, “Please tell me your name.” But he said, “Why is it that you ask my name?” And there he blessed him. 30 So Jacob called the name of the place Peniel, saying, “For I have seen God face to face, and yet my life has been delivered.” (Genesis 32:25-30)
This is explained by Hosea as again being an angel:
He [Jacob] strove with the angel and prevailed. (Hosea 12:4)
The 3 angels and the Trinity?
It wasn’t part of the question, but it’s worth nothing: The three angels are not in any way related to the idea of a Trinity, and the second and third angels which go off to destroy Sodom do not manifest God in the same direct first-person way as the first.