Can I replace the crank on a Raleigh m20 with one from a Schwinn Ranger?
If they're both the same interface, then it should be okay.

There's a fair chance they're both square taper, so you'll need a 14mm socket and a puller to get the good crank off.  

You might have problems with the chain line, and the front derailleruerueure will need aligning.

How did you mess up the crank on the raleigh originally?

How's your bottom bracket?  While the crank is off you may as well service it.