It’s easy to set your game in a fantasy world, and much harder to get by in a sci-fi realm. Using the real world falls somewhere in between.
The reason for this is the shared understanding of the faux-medieval culture to most people likely to be playing your game. Everyone understands knights, dragons, merchants and maidens. Using these cultural shorthands save a lot of explaining, allowing you to focus on the differences that are important to your game, whilst being able to farm out some concepts to a shared understanding.
It’s a lot harder in a science fiction setting as there’s no shared understanding, especially if you are creating your own future. The world building has to be much more in depth, you have to make choices over what you are aiming for, whether it’s Blade Runner, Star Trek, Firefly or something completely different, you have to make your world choices, and make sure people understand them.
Picking the middle ground of the ‘real world’ throws up a few more difficulties, you have probably got a shared understanding of some facets, but by no means all. The real problem can lie in the need for correctness that some of your players may exhibit when presented with a real world scenario. In a fantasy world, you get to decide how fast a dragon flies. In the real world you’d better get the airspeed of a 747 right, or have a good reason for the abstraction, or you’ll be defending yourself from nitpickers forever.
Pick your game setting carefully, make use of fantasy settings to give you a shorthand, but don’t force this, and don’t let yourself become lazy. Pick what works for the game you want to create, and be prepared for the work you need to do to make it real.