It's definately possible. One of my friend did it. He flew YYZ-HKG rt on AC. Credited the outbound on Aeroplan and credited the return on to his UA account. And yes he told me he did it by providing his card at check-in both times rather than providing them at the time of making the reservation.