The essence of this poem is struggling to survive; pressing on to live as long as you can in the face of death, even if it means suffering.
As many have written here, it appears that Thomas is writing this prototypical villanelle ode to his sickly, dying father. Thomas reveals this to the reader in the very last stanza when he writes:
And you, my father, there on the sad height,Curse, bless, me now with your fierce tears, I pray...
However, Thomas himself lived a life wrought with pain and struggle. He suffered from neuroticism and mental illness from an early age. He also barely made ends meat as a writer. He and his family were regularly on the cusp of poverty, and he would write letters to fellow writers like T.S. Elliot, soliciting money.
When he wrote this poem in 1947, he was struggling with severe alcoholism and was in the midst of an unhappy marriage. His talent and celebrity were at their peak, but he wasn't rewarded financially. He was toiling as a frequent guest reader on BBC Radio. While the amount of airtime helped him gain a healthy following in London, his managers never gave him a staff job, citing his alcoholism as the reason.
To summarize, the theme of this poem applies to Thomas and his father. Both were struggling to survive.
Do not go gentle into that good night
Don't succumb to the peaceful release of death.
Old age should burn and rave at close of day;
Rage, rage against the dying of the light.
Struggle against death, referred to here as "the dying of the light."
Dylan connects all men together--wise men, good men, wild men--by writing that they all will face death. When they do, he urges them to fight--"rage"--for more life, rather than gracefully slipping into darkness. No matter what these men have done with their life, good or bad, they shouldn't give up the struggle for more.
This poem was featured prominently in the sci-fi movie Interstellar, written by Jonathan and Christopher Nolan. Appropriately, the movie is about mankind's struggle to overcome imminent extinction.