In "Ozymandias," the speaker recalls what a traveller from an ancient land (Egypt) tells him about a relic. He describes a ruin of a monument to Ozymandias (Greek for Ramses II). In this sonnet, Shelley playfully but seriously challenges the idea that ambitious kings (or politicians) whose life's work is to achieve power is not only selfish and pretentious but it is fleeting and therefore, in the grand scheme of things, meaningless. The artist's work will outlast the king's but even the artist's work is subject to physical decay or cultural neglect over time.
The speaker notes that the sculptor captured the king's proud and greedy passions in his "sneer of cold command" but even his work might soon be lost as the face of the king is already half buried in the sand. He concludes that "nothing beside remains" complementing the theme that life is fleeting for everyone, king, artist, and commoner alike. Had the king spent his life in service of his people or had the sculptor spent his life creating innovative works rather than memorializing (albeit somewhat mockingly) a self-indulgent fascist, both would have been more respected and more remembered. There is a theme about mortality not discriminating but the more prominent theme is a veiled criticism of selfish rulers with a secondary criticism of obsequious artists.
However, there is a subtle indication that Shelley does believe that art does have a greater chance of being remembered. Consider that the sculptor's work, even if it is to honor a fascist king, was mocking. The king would've intended this monument to outlast him; unfortunately for him, the sculptor got the last word in and his mocking tribute to the despot's smile is what remains. Shelley himself, in this poem, is mocking the same king (and others like him). So, Shelley is essentially doing what the sculptor did, also in the hope that his criticism or satiric mocking will serve to warn future generations of the dangers of self-important rulers.