What are the pros and cons of basing the world on the characters found in it and conversely what are the pros and cons of basing the characters on the world in which they live?
The advantages of building a world and then basing the characters on it is that this is generally the direction that the real world works. Your parents were not chosen based on what profession you were supposed to enter. They were your parents first, and they shaped your profession. Building in this order typically helps make very credible worlds because you're not cheating when you build the world.
However, few stories are focused on the world. They usually center around characters and a plot. In these cases, you tend to want to avoid weakening your plot just to fit the world. Nothing's worse than building up your story of the boy turned king than finding out that the world brought the black plague to his castle and he died a horrible death just before the plot really took off. Many stories rely on exceptional happenings, and it can be hard to build a world and then find those exceptional events. It can be easier to bend your world to fit your characters. However, this comes at a price: the believably of your world can go down because the characters start "getting lucky" too much.
The ideal solution is to balance both approaches. Make it so that its hard to tell from your final product whether you took the world first or character first approach. Create a beautiful gleaming plot with rich characters, and make sure the world fits that. Make sure that the world looks like it really could have generated these characters.
Stories are fundamentally about people, not places. The psychology of why we like stories has been fairly well worked out, and the archetypes of stories are fairly well understood. At its simplest, a story is about a character with a desire, the things that frustrate that desire, the things the character does to overcome those things and achieve their desire, and the final achievement of loss of the desire.
Everything else in a story revolves around this. If a story invents a world (rather than using the one we live in) it is because an invented world is a better vehicle, in some way or another, for the staging of this conflict between a particular desire and the things that frustrate that desire. A fantasy world may create the conditions for a new desire, or new ways to frustrate a desire, or new ways to overcome those frustrations. These need to be analogs of real desires, real frustrations, and real opportunities or the story will not hold the reader, but a fantasy world can provide a new stage on which to tell one of the archetypal stories and to highlight its key conflicts in different ways.
All of which means that character comes first, and the world creates the right stage on which to tell the story of the character.
That does not mean you can't do worldbuilding and then discover a character and place them in that world. But it means that actual storytelling begins with character, not world building.