Can it be in any unit ?
Can it be in grams, Kilograms or Unified atomic mass( to calculate centre of mass of a compound)
Or should I convert them to kg and then proceed?
It doesn't matter. The centre of mass depends on the ratio of the masses so as long as you use the same units for mass in your calculations the result will be the same.
I dont see how the choice of units can matter in any calculation whether it be centre of mass or not. See unit is just an internationally accepted standard to measure quantities. However if I want to use some regional units for the same purpose, it would not make any difference. For example, whether I measure the length of a road in miles or metres or some other unit, the length of road will still remain the same!
Anyway for the purpose of centre of mass (or any other calculation), it is always preferred to use SI unit (kg, in your case). However, it would hardly make a difference even if you took it in grams or a.m.u. or pounds or whatever.
The concept of center of mass tells you about the position of the combined mass of the bodies in a system . And it is calculated using this formula
$r_{cm} = \frac{m_1r_1 + m_2r_2 + .....}{m_1 + m_2 + ...}$
So both the numerator as well as the denominator have mass . So it doesn't affect the $r_{cm}$ and you can take any units of mass in consideration but remember to use one unit at a time only i.e don't take different units for numerator and the denominator.
Hope it helps ☺️.
This is the CM equation (for 2 body's)
$$R_{CM}=\frac{m_1\,r_1+m_2\,r_2}{m_1+m_2}= \frac{m_1\left(r_1+\frac{m_2}{m_1}\,r_2\right)}{m_1\left(1+\frac{m_2}{m_1}\right)}=\frac{r_1+\frac{m_2}{m_1}\,r_2}{1+\frac{m_2}{m_1}}$$
the equation show you that the unit of the mass cancel thus the CM unit is the unit of $r_i$ for example $[m]$
General case
$$R_{CM}=\frac{r_1+\frac{m_2}{m_1}\,r_2+\frac{m_3}{m_1}\,r_3+\ldots+\frac{m_n}{m_1}\,r_n}{1+\frac{m_2}{m_1}+\frac{m_3}{m_1}+\ldots+\frac{m_n}{m_1}}$$