Can I still get pregnant if I have open heart surgery and change my valve?

Yes. Timing is important. And valve type is important due to anticoagulation. If mitral, and repaired, very good likelihood. Also depends on associated signs, like heart failure, sepsis and cause of valvular trouble.
See a doctor. Pregnancy after heart surgery is possible, but can be risky depending on the operation and the patient. Mechanical valves are especially risky because of the risk of clotting and the risks to the baby related to the blood thinning medications. Consultation with a physician is important.