The problem is that you introduced single quotes around the identifier. They are not needed. See the corrected code below as it does exactly what you want:
var _UCID = 'ef6a5118-5282-4930-bb21-4f825da20840'
var UID = "#" + _UCID;
alert(UID);
alert($(UID).html());
Regards,
— Manfred