Yes but it depends on when you go during your pregnancy whether or not it will be accurate. It is possible that a doctor may see something on an earlier ultrasound that isnt accurate to your baby. Most likely by sixteen and twenty weeks doctors should be able to tell what sex a baby is.
Yes you can tell the sex of the baby on the ultra sound if the baby is laying in the correct position. If not the doctor sometimes can get the baby to move so you can tell the sex.
An ultrasound can determine gender from approximately 12 weeks gestation on. Most doctors and ultrasound technicians will only do gender determination after 18 weeks gestation, when the accuracy is much higher.