The distance between moon and earth is just 384,400 km. So, if we can travel (from moon) to another planet, we also can travel (from earth) to the same planet. But I've read that some scientists want a moon base although we can have an earth base. Why? What are the advantages of a moon base.
The reason many scientists want to create a Moon base isn't because of distances in space, it's because of gravity wells. The amount of energy to escape the gravity well of a body in space depends on the mass of said body. For example, the amount of energy required to take off from Earth and go to low Earth orbit is MUCH higher than the amount of energy it takes to take off from the moon and reach low Earth orbit. The Moon has a much lower mass and therefore a much lower gravity well.
The practical XKCD 681 gives a very intuitive example of the amount of energy it takes to get out of a planet (or moon's!) gravity well.
The amount of fuel a rocket needs to "escape" the planet is shown by the depth of the well in this chart. On the bottom right you can see that the gravity well of earth is much deeper than that of the Moon.
Another easy example is in fuel costs. This image shows fuel costs of the Apollo Moon missions:
Don't be fooled by the broken bar for launch. If you were to actually draw this chart to scale, it would be impossible to read as launch fuel costs were around 96% of fuel costs for the entire mission. This means that the Apollo mission used 96% of it's fuel taking off and getting into low Earth orbit. With the remaining 4% of fuel the astronauts went to the Moon, entered orbit, landed, took off, and flew back to earth.
In short, having a Moon base which produces fuel from resources available on the Moon (water ice probably) would mean that you could save enormous amounts of fuel on all missions in space. Instead of having to launch all the fuel you will need on a Mission from Earth (where the launch is very expensive), you could simply refuel at the Moon.
In fact, if asteroid mining ever becomes a reality, it will likely be cheaper to import metal from asteroids for use in earth orbit than to send the metal up from Earth because although asteroids are much further away, the energy requirement to move there and back is far lower than a launch from the surface of Earth to space, or as the old maxim goes: "Once you've reached orbit, you're halfway to anywhere"
If we can get some part of fuel production going on the moon this could be a huge help. For example if we can mine water that can be split into hydrogen and oxygen with solar energy.
Given local fuel production we have a fuel supply in a much shallower gravity well.