Yes, you can take an eye exam and buy some prescription glasses temporary under the guide of eye doctors. But i don't think you need buy new prescription eyeglasses. I heard that pregnant can cause the changes of vision for some extend. But it will recover your vision after you have a baby. So, i think you shall be prudent to buying new eyeglasses to avoid permanent damages to your eyes.
Of course you can. But before you have eye exam, you should tell the doctor that you are pregnant. I think the doctor will be careful when he give certain tests to pregnant women. However, if you need to go to have an eye exam, you'd better ask someone to go with you, thus he or she can take good care of you. During the eye exam, some eye drops or certain tests may not be taken due to the pregnancy.
At the beginning you need to tell your optometrist that you are pregnant in order that he or she will not use some eye drops which are not good for your baby. Just be warned that while you're pregnant, your vision may be changed a lot as the hormones can cause your corneas to thicken. Some doctors won't dilate the eyes while you're pregnant, but it's considered safe by most. Best wishes for a happy & healthy pregnancy!