Yes, you definitely can. If your broken Mac is still bootable, the easiest option would be to back up the data from it to an external drive with the help of Time Machine. Or another option would be to use Target Disk Mode to transfer the data directly from one Mac to the other.