Could I ask a recommendation letter from a professor who left the university?
If the faculty is retiring to emeritus status then they can still write on letterhead. Many emeritus still maintain an active research profile or use the time to write, but in any case they might be willing to write for you. Many enjoy keeping one foot in the teaching/advising world. 

There's nothing to be lost by asking. 

And from the perspective of people on admissions committees, a strong letter from an emeritus faculty who compares this student against their thirty or forty years of other students can be very persuasive.