Genesis 28:18 (NLT)
The next morning Jacob got up very early. He took the stone he had
rested his head against, and he set it upright as a memorial pillar.
Then he poured olive oil over it.
Olive oil was very important in ancient Israel. It was used for not only as food and for cooking, but also for lighting, sacrificial offerings, ointment, and anointment for priestly or royal office(src).
Olive Oil in Bible Times:
Olive oil was considered to be one of the great sources of wealth in the days of King Solomon (cf.
I Kings 5:11; II Chronicles 2:10). Solomon gave to Hiram each year in
return for services rendered by his men, among other things, twenty
thousand baths of oil, one bath being about seven and one-half
gallons. The prophets Ezekiel and Hosea make mention of the exporting
of oil to other lands (Ezekiel 27:17; Hosea 12:1). Oil has been used
for a great variety of purposes in the Orient. It largely took the
place of butter in eating, and for cooking purposes it was used in
place of animal fat. Ezekiel mentions three important items of diet of
which oil is one, and flour and honey are the other two (Ezekiel
16:13). And olive oil was used almost exclusively for light in lamps.
The most famous example of this is "the ten virgins, which took their
lamps, and went forth to meet the bridegroom" (Matthew 25:1). Also oil
is used today in Bible lands in the manufacture of soap, and it is
quite likely that it was so used in Bible days. And oil was often used
for anointing the body. Naomi told Ruth, "Wash thyself therefore, and
anoint thee, and put thy raiment upon thee, and get thee down to the
floor" (Ruth 3:3). Then oil was many times used in various religious
ceremonies. It formed a part of the meal offering (Leviticus 2:1). The
prophet was anointed with oil when he took over his duties (I Kings
19:16). The priest was also anointed with oil when he took over his
duties (Leviticus 8:12). And the king was anointed either by a prophet
or by the priest (I Samuel 16:13; I Kings 1:34). In New Testament
times the sick were anointed for the healing of their bodies (Mark
6:13; James 5:14). (source)
Where did Jacob get the Oil?
Matthew Poole's Commentary
As a monument of God’s great kindness and gracious manifestation of
himself to him, which might bring this mercy to his remembrance in his
return, Genesis 31:13. This was an ancient practice among the
patriarchs, Genesis 35:14; but afterwards, upon the growing abuse of
it among the heathens, it was forbidden by God, Leviticus 26:1 Deu 7:5
The oil he brought with him either for food or medicine, or for the anointing of himself, as need required;
and poured it upon the top of the stone, as a token of his
consecration thereof to this use to be a memorial of God’s favour to
him. Oil was used in sacrifices, and in the consecration of persons
and places, Exodus 30:25,26 40:9.
Though Jacob lived at a very early age of the history of Israel, the use of Olive oil seems to be popular from around that time, as confirmed by Matthew Poole in his commentary. 400 years after Jacob, Moses also used Olive oil for many purposes. Seems like things didn't change much within 400 years.
Command the Israelites to bring you clear oil of pressed olives for
the light so that the lamps may be kept burning. (Exodus 27:20, NIV)