A good question with unfortunate examples. United Mileage Plus members can collect and spend miles on Delta flights (not express, comair, atlantic coast, etc) anyway. However, in general, one doesn't get miles for a different airline. For instance I got bumped in January from BOS
and couldn't collect the DL
miles. It worked out fine in my case, but would be a major bummer if it was a mileage run or tied to getting a status upgrade. I could be wrong about other ticketing situations though.