A Lancashire council is to buy a group of properties to house refugees from Afghanistan and homeless people.