Various Bible translations refer to immigrants and refugees as strangers, foreigners, aliens or sojourners. For the most part there is no distinction between those terms, as in this verse from Deuteronomy:
19 You shall also love the stranger, for you were strangers in the land of Egypt. (NRSV, Deuteronomy 10:19)
19 And you are to love those who are foreigners, for you yourselves were foreigners in Egypt. (NIV, Deuteronomy 10:19)
19 So you too should love the resident alien, for that is what you were in the land of Egypt. (NABRE, Deuteronomy 10:19)
19 Love the sojourner, therefore, for you were sojourners in the land of Egypt. (ESV, Deuteronomy 10:19)
Abram (aka Abraham) immigrated to Haran from the land of Ur (Genesis 11:31) and then to the land of Canaan (Genesis 12:1-3). Later, Abram left Canaan to escape a severe famine and lived temporarily as a foreigner in Egypt (Genesis 12:10).
Abraham's grandson Jacob (aka Israel) and his entire family immigrated to Egypt because of famine (Genesis 46:26-27).
Elimelech and Naomi (mother-in-law of Ruth) and their sons immigrated to Moab to escape famine in Judah (Ruth 1:1-2).
Mary and Joseph took baby Jesus and fled to Egypt as refugees to escape King Herod's order to kill all the baby boys in Bethlehem (Matthew 2:13-14).
Aquila and Priscilla (associates of the apostle Paul) were refugees in the Greek city of Corinth because Jews had been expelled from Rome (Acts 18:1-2)
21 You shall not wrong or oppress a resident alien, for you were aliens in the land of Egypt. (NRSV, Exodus 22:21)
19 And you are to love those who are foreigners, for you yourselves were foreigners in Egypt. (NIV, Deuteronomy 10:19)
14 You shall not withhold the wages of poor and needy laborers, whether other Israelites or aliens who reside in your land in one of your towns (NRSV, Deuteronomy 24:14)
Other verses: Leviticus 19:33-34, Deuteronomy 1:16, Deuteronomy 27:19, Numbers 9:14, Jeremiah 7:5-7, Jeremiah 22:2-3, Ezekiel 47:21-23, Zechariah 7:9-10, Malachi 3:5
9 When you reap the harvest of your land, you shall not reap to the very edges of your field, or gather the gleanings of your harvest. 10 You shall not strip your vineyard bare, or gather the fallen grapes of your vineyard; you shall leave them for the poor and the alien: I am the Lord your God. (NRSV, Leviticus 19:9-10)
28 At the end of every three years, bring all the tithes of that year’s produce and store it in your towns, 29 so that the Levites (who have no allotment or inheritance of their own) and the foreigners, the fatherless and the widows who live in your towns may come and eat and be satisfied, and so that the Lord your God may bless you in all the work of your hands. (NIV, Deuteronomy 14:28-29)
Other verses: Deuteronomy 24:19-22, Deuteronomy 26:12-13
48 “A foreigner residing among you who wants to celebrate the Lord’s Passover must have all the males in his household circumcised; then he may take part like one born in the land. No uncircumcised male may eat it. 49 The same law applies both to the native-born and to the foreigner residing among you.” (NIV, Exodus 12:48-49)
21 So you shall divide this land among you according to the tribes of Israel. 22 You shall allot it as an inheritance for yourselves and for the aliens who reside among you and have begotten children among you. They shall be to you as citizens of Israel; with you they shall be allotted an inheritance among the tribes of Israel. 23 In whatever tribe aliens reside, there you shall assign them their inheritance, says the Lord God. (NRSV, Ezekiel 47:21-23)
Other verses: Numbers 9:14, Leviticus 19:33-34
12 Rejoice in hope, be patient in suffering, persevere in prayer. 13 Contribute to the needs of the saints; extend hospitality to strangers. (NRSV, Romans 12:12-13)
1 Keep on loving each other as brothers and sisters. 2 Don’t forget to show hospitality to strangers, for some who have done this have entertained angels without realizing it! 3 Remember those in prison, as if you were there yourself. Remember also those being mistreated, as if you felt their pain in your own bodies. (NLT, Hebrews 13:1-3)
28 There is no longer Jew or Gentile, slave or free, male and female. For you are all one in Christ Jesus. (NLT, Galatians 3:28)
9 Don’t lie to each other, for you have stripped off your old sinful nature and all its wicked deeds. 10 Put on your new nature, and be renewed as you learn to know your Creator and become like him. 11 In this new life, it doesn’t matter if you are a Jew or a Gentile, circumcised or uncircumcised, barbaric, uncivilized, slave, or free. Christ is all that matters, and he lives in all of us. (NLT, Colossians 3:9-11)
Jesus said we should treat the poor and oppressed of the world with the same care and concern as we would treat Jesus, Himself:
34 “Then the King will say to those on his right, ‘Come, you who are blessed by my Father; take your inheritance, the kingdom prepared for you since the creation of the world. 35 For I was hungry and you gave me something to eat, I was thirsty and you gave me something to drink, I was a stranger and you invited me in, 36 I needed clothes and you clothed me, I was sick and you looked after me, I was in prison and you came to visit me.’ 37 “Then the righteous will answer him, ‘Lord, when did we see you hungry and feed you, or thirsty and give you something to drink? 38 When did we see you a stranger and invite you in, or needing clothes and clothe you? 39 When did we see you sick or in prison and go to visit you?’ 40 “The King will reply, ‘Truly I tell you, whatever you did for one of the least of these brothers and sisters of mine, you did for me.’ (NIV, Matthew 25:34-40)
Jesus also taught that His command to "Love your neighbor as yourself" (Mark 12:31) applies to all people of the world, regardless of race, religion or nationality. There is more information in this article: The Greatest Commandment and the Parable of the Good Samaritan.
1Merriam-Webster Dictionary, https://www.merriam-webster.com/