Sure. Even if you wear glasses, you can become a pilot,too. As long as your vision can be corrected to 20/20 if your vision is not 20/20 or better, you can obtain a Pilot Certificate. That is to say, you must wear corrective lenses including glasses and contact lenses when you operate an aircraft if you are nearsighted. And if you are farsighted, you also need to have corrective lenses on you while operating an aircraft. Good luck!
Most people may misconception that one can't get Pilot Certificate if you have poor vision. But that is not the truth. If you have poor vision but can be corrected to 20/20 vision, you still have a chance to be a pilots. If you are nearsighted or farsighted, you will have a restriction on your medical stating that you must wear prescription eyeglasses while operating an aircraft. So, don't worry, you still have a chance to be a pilot.