Can I charge my MacBook Pro from an older iMac? After dropping my 2012 MacBook Pro, the build-in magnetic MagSafe charging system doesn’t seem to be working any more. Is there a way to charge it from an old (2002) iMac, to recover my files? Or any other way?
There's no other way of charging a 2012 MacBook Pro than through the MagSafe power port. If that has stopped functioning, you cannot charge the laptop as usual.
Your options are primarily:

getting the MagSafe power port repaired
taking out the battery and charging it externally and put it back
take out the hard drive or SSD (depending on model) and transfer data externally

To recover the files I would prefer the last option, taking out the drive. It is an ordinary SATA interface, so you should be able to buy a cheap USB-to-SATA interface at most computer stores, that would enable you to transfer the data to another computer.