In response to your question, the answer is "yes, they can". Until the bank or someone else takes ownership of the property the current homeowners remain in charge and they can do with the home what they like. So they can indeed choose to rent the home and collect that rent as payment for its use.
Also, you have a contract with them which obligates you to "Pay Rent Or Quit", and because you have this agreement in place you are expected to abide by it whether they continue to abide by the agreement they have with their lender or not. You don't want your landlords bad financial situation to tarnish your good reputation and if you discontinue paying your rent, your landlord would be completely within their rights to file a Notice of Eviction against you.
I would agree that looking for another place to live might be a wise thing to do. Even though you could conceivably be allowed to remain in the home and continue to rent it (assuming you have a valid lease in place) for the remaining duration of your lease agreement, you might not want to put yourself and your family in such an uncertain and stressful situation.
Good luck with your situation, I am sorry to hear that you are in such a trying time. If there is any way that I can assist you please do not hesitate to give me a call or drop me a line at Tisza(at)HomesByTisza.com.
Take care and have a great day!
Tisza Major-Posner, Realtor DRE #01794679, IVPG Realty, (909) 837-8922