The word ‘LORD’ in Genesis 18:1 is referring to God. Here is a quote from a previous answer on BibleQ:
In the Old Testament, it is common to see LORD in upper case letters (actually in small caps). In these cases, the Hebrew word is יהוה (Yahweh). This is the personal name of God (see Exodus 3:13-15 and Exodus 6:2-3) and means something like “He will be who he will be”.
Abraham’s visitors are described as ‘the LORD’ (Genesis 18:1, 18:20-22), ‘men’ (Genesis 18:2 & 18:22) and as ‘angels’ (Genesis 19:1). From this we gather that God appeared to Abraham in the form of three angels, with the appearance of men. God had previously appeared to Abraham in this way (Genesis 17:1, 22).
In Genesis 18:3 Abraham uses the word ‘Lord’ (not LORD) to address his heavenly visitors:
“O Lord, if I have found favour in your sight, do not pass by your servant.”
This is a term of deep respect recognising the authority and leadership of the one being addressed. Abraham uses it elsewhere to address God (Genesis 15:2, 8). Sarah uses a similar word to describe Abraham himself in Genesis 18:12.
Occasionally people speculate that the “Lord” in Genesis 18 is Jesus. However, Jesus wasn’t born until nearly 2000 years later, and there is no evidence that he had any conscious existence before his birth.