Quality stock posting will happen based on UoM maintained in QM view of the Material Master.
Purchasing will happen based on UoM maintained in Purchasing view of Material Master.
If you have maintained the proper conversion factor in Additional Data of the Material Master, stock posting will never happen. So consider all the probabilities & maintain the conversion factor as per that in Material Master.
There is no relation between the UD code & Conversion factor.