I've done that many times. If someone needs help and has cables, as long as you know how to connect them properly, the right thing to do is to help someone in need. Plus it doesn't really cost you anything more than 5 minutes of time. Good karma.
I could only wish that someone would do the same for me if I was in the same predicament. I know I have BMW Assist and AAA, but I'd rather get a jump and get going than wait for a tow truck.