First of all, most of this theory is verrrrrry loose. It does not have a strong foundation (I've got a lot going on, so I didn't have a whole lot of time to research). Now, the first thing to get out of the way; these two are not directly related, I believe that they are alternate realities from each other. Don't starve, a post-apocalyptic world, where the player has failed to keep the forces of evil at bay.
We've all seen the Don't Starve x Terraria Crossover, but believe it or not, Don't Starve is the sequel to Terraria! Don't Believe me? See the proof below.
(This theory is slightly based off of my previous theory, so I recommend reading that also)