Both forms are correct though we see the first form too often.
Here the second form is preferable because it may mean that he really owns the whole earth, which is impossible for any human being.
In certain cases both the forms may be correct. For example, he speaks as if he is rich (probably he may be rich). He speaks as if he was rich means he is not rich but speaks like a rich man. Even if the first clause is in past tense we have to use simple past after. That is, we should say
He walked as if the whole earth belonged to him.
He walked as if the whole world had belonged to him.