Technically, I don't think you are supposed to use the canceled ticket credit on codeshares.
However, one reason the ticket agents might be lenient about this is because it is really straightforward to book a cheap refundable UA ticket, and then change it to the flights (including codeshares) that you desire. This works only with ticket credit or type B vouchers.