If you've created a world, nothing can take it away from you (well, unless you sign it away). Same for your story.
Rejection by one publisher doesn't mean your story, much less your world, is dead in the water. Some authors got rejected by every publisher, and eventually one came back around and took a story (years later).
There are plenty of options to self-publish nowadays too.
Yes, maybe the editors are rejecting your world - in which case no story set in that world is going to sell to that editor. That can happen. Best I can tell you is that that's not every editor. And, unless there's a conceptual design flaw that makes your world completely break everyone's disbelief, someone out there will like your world (I mean, you like it right? That's one in the bag).
As advice for what type of world to build: Build one that you can write a number of different stories in. And different types/styles of story as well. That'll mean you can reuse the hard work you've put into the background, as well as make for a universe to tie all your work together.
I'd wait to do one-off worlds until you've sold a novel. (Unless the monkey on your back tells you to).
If you're just writing shorts, you're not going to go to the trouble to build a whole world.