Can an eye doctor know your contact lens prescription just by looking at your glasses?

To some degree. If your glasses prescription is known, your contact prescription should be as well. If the eye doctor just looks at the glasses with his/her naked eye, he/she may get a rough idea of your prescription. If they look at the glasses with a lens meter, he/she will know the glasses' exact prescription, and have a good idea of the contact prescription based on that.
Contact lens. Yes, in many cases the power of the contact lenses can be predicted from the glasses prescription, but measurement of the corneal steepness needs to be made to calculate the base curve of the contact lenses. Then a trial wear of the contact lens is recommended to make sure you are happy with the clarity and comfort of the contact lens.
No. An estimation can be made for the power of the contact lens, but the base curve and diameter have to be fitted to your eye. Thus, typically a trial lens is used.

Related Questions

Will the eye doctor give me a contact lens prescription if it's my first time wearing a corrective lense?

Possibly. If you are interested in wearing contact lenses and your ocular health, refraction, and your desire are all acceptable, then a contact lens fitting can be requested. You will be instructed on the care and technique of wearing contacts safely. It is also a good idea to have a pair of spectacles for backup.
Yes. Yes if your correction is amenable to contacts. Your doctor will also check the health of your eye to see if your eye would tolerate wearing a contact lens.

Will an eye doctor give you contact lenses before ever getting glasses?

Rarely. If you need contact lenses, you should probably get a pair of glasses to go along with them. You shouldn't be wearing your contact lenses all day everyday. Your eyes need a break and glasses can allow you to keep your improved vision while not wearing the contacts.
Not advised. They really should not. You should always have a pair of glasses to fall back on in the event that you have trouble with or lose your contact lenses.