Yes, but the meaning is a bit different. I could buy myself a nice house if I earned a lot of money. (To me, this implies that you would save the money that you earned and pay cash for a nice house) I could buy myself a nice house if I were earning a lot of money.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.