Yes, if all the terms in an equation have the same units, it is necessary that they have the same dimension.
No, if all the terms in an equation have the same dimensions, it is not necessary that they have the same unit. It is because two quantities with different units can have the same dimension, but two quantities with different dimensions cannot have the same unit. For example angular frequency and frequency, both have the dimensions but units of angular frequency is rad/s and frequency is Hertz.Another example is energy per unit volume and pressure.Both have the dimensions of but units of pressure is N/m2 and that of energy per unit volume is J/m3