Yes. It is determined from the context of the scriptures, and the source is from the Old Testament. Depending upon the subject matter, both "heaven" and "earth" could mean and did mean different things.
Heaven could be the realm where God sits on His throne, as in Deu. 4:39,
Know therefore this day, and consider it in thine heart, that the Lord he is God in heaven above, and upon the earth beneath: there is none else. (KJV)
Or it could mean the rule and authority of kings/queens and their royal houses, as in Isa. 13:5,
“They come from a far country, from the end of heaven, even the Lord, and the weapons of his indignation, to destroy the whole land.” (KJV)
Isaiah was speaking to the king of Babylon and telling of the fall of Babylon in chaps 13 & 14. In 13:5, "the end of heaven" referred to the borders of the king's rule over his land. So, heaven here was Babylon's kingdom.
It was a type of heaven in that God allowed the king to rule above and over the people of the land of Babylon (or any nation), and that the kingdom /rule was higher than the common or ordinary people of the "earth" over which the king ruled.
Most often, in the Old Testament, "earth" was synonymous with Israel. But, it stood for the land or the people who occupied the land to whom God was speaking, as in Isa. 1:1-2,
The vision of Isaiah the son of Amoz, which he saw concerning Judah and Jerusalem in the days of Uzziah, Jotham, Ahaz, and Hezekiah, kings of Judah.
2 Hear, O heavens, and give ear, O earth: for the Lord hath spoken, I have nourished and brought up children, and they have rebelled against me.
We identify that the prophet is speaking to Judah and Jerusalem, or the people of both. In verse 2 he calls both the "heavens" and the "earth" of Judah and Jerusalem to hear the words of God. The "heavens" were the kings and rulers of Judah, and the "earth" was the ordinary people dwelling in Judah, the tribe of Judah.
So, we have to identify the people who were being warned of judgment, who the prophet was sent to, and was speaking with to know which "heaven" or king and which "earth" or land was under judgment.
Micah 1:2,
Hear, all ye people; hearken, O earth, and all that therein is: and let the Lord God be witness against you, the Lord from his holy temple. (KJV)
The people of the first half of the couplet were synonymous with the "earth" in the second half of those who were called to hear. And verse 1 tells us that those were the people of Samaria and Jerusalem.
Then God used both "heaven and earth" together as the covenant, the promise between the two, as in Deu. 4:26,
“I call heaven and earth to witness against you this day, that ye shall soon utterly perish from off the land whereunto ye go over Jordan to possess it; ye shall not prolong your days upon it, but shall utterly be destroyed.” (KJV)
What was going to witness against the tribes of Israel but their covenant with God? Moses was reminding, exhorting them to keep the commandments of God, their covenant with God throughout all of chap. 4. Keeping the covenant was the subject of the entire chapter, so if they broke that covenant it would be used to charge them with their sins.
In discussing the return from the Babylonian captivity to rebuild Jerusalem, Isa. 65:17-18,
17 For, behold, I create new heavens and a new earth: and the former shall not be remembered, nor come into mind.
18 But be ye glad and rejoice for ever in that which I create: for, behold, I create Jerusalem a rejoicing, and her people a joy. (KJV)
The new heavens and new earth of Isa. 65 was the renewing of their agreement to live according to the commandments of God, the system He provided for their return to Jerusalem under the conditions of keeping His laws. He did not literally destroy the entire earth and recreate it again for their return to Jerusalem.
It looked forward to the new heavens and new earth of the new covenant of the gospel of Christ, under the everlasting kingdom of Christ. The old heaven and earth was the old covenant law with the tribes of Israel. So, when Christ said in Matt. 24:35,
"Heaven and earth shall pass away, but my words shall not pass away." (KJV)
He was not referring to the literal heavens nor the literal earth. He was speaking of the change in the covenants from the old to the new. The old covenant was going to have to pass, and that is what all of Hebrews spoke of... the waxing and aging of, the passing away of the old covenant law. It was replaced with the new covenant of the gospel of Christ, which fulfills the old covenant.