The Greek word καταβολή (katabolé = "foundation") occurs 11 times in the NT, 10 of these are in the phrase, ἀπὸ/πρὸ καταβολῆς κόσμου = "from/since foundation/creation of the world/universe" or very similar.
Those that refer to the time "ἀπὸ = from/since the foundation of the world"
- Matt 13:35 - So was fulfilled what was spoken through the prophet: “I will open My mouth in parables; I will utter things hidden from the foundation of the world.”
- Matt 25:34 - Then the King will say to those on His right, ‘Come, you who are blessed by My Father, inherit the kingdom prepared for you from the foundation of the world.
- Luke 11:50 - As a result, this generation will be charged with the blood of all the prophets that has been shed from the foundation of the world
- Heb 4:3 - Now we who have believed enter that rest. As for the others, it is just as God has said: “So I swore on oath in My anger, ‘They shall never enter My rest.’ ” And yet His works have been finished since the foundation of the world.
- Heb 9:26 - Otherwise, Christ would have had to suffer repeatedly since the foundation of the world. But now He has appeared once for all at the end of the ages to do away with sin by the sacrifice of Himself.
- Rev 13:8 - All who dwell on the earth will worship him, whose names have not been written in the Book of Life of the Lamb slain from the foundation of the world.
- Rev 17:8 - The beast that you saw was, and is not, and is about to come up out of the abyss and go into destruction; and those dwelling on the earth whose names are not written in the book of life from the foundation of the world will wonder, seeing the beast which was, and is not, and yet will be.
[NOTE: There is a closely related phrase, "creation of the world" in Matt 13:35, Luke 11:50, Rom 1:20, Heb 9:26, etc; and "beginning of creation" in 2 Peter 3:4, etc.]
Those that refer to the time "πρὸ = before the foundation of the world"
- John 17:24 - Father, I want those You have given Me to be with Me where I am, that they may see the glory You gave Me because You loved Me before the foundation of the world.
- Eph 1:4 - For He chose us in Him before the foundation of the world to be holy and blameless in His presence. ...
- 1 Peter 1:20 - He was known before the foundation of the world, but was revealed in the last times for your sake.
The answer to the OP's question is very divisive and controversial so I will answer in two ways:
According to BDAG, the word καταβολή (katabolé = "foundation") has the following meaning from BDAG:
The act of laying something down, with implication of providing a base for something. Readily connected with the idea of founding in
the sense of beginning ... this may be the meaning of Heb 11:11
The word κόσμος (kosmos = world, universe, inhabitants of the world, etc) has a variety of subtle meanings but the one pertinent in this context is the following meaning in BDAG:
- the sum total of everything here and now, the world, the (orderly) universe
Now, it is almost certain that the ancients did not distinguish, as we do today, between our world and the rest of the totality of the universe and so any such difference or meaning in the text cannot be read into the text.
In the case of John 17:24, it means that God loved Jesus before creation occurred.
Since God is Love (1 John 4:8, 16), then there never was a time when God did not love Jesus. That is, God cannot exist without loving. Therefore, in the case of John 17:24, Jesus was loved by God before anything else existed and was always loved.