You can usually have only 1 legend per plot. However, you can use a small workaround to make two overlapping plots, and plot two legends for each of them with different units as you require. Kindly follow the below code demo:
p = plot(x, y1, 'r', x, y2, 'g', x, y3, 'b');
p2 = plot(x, y1, 'r', x, y2, 'g', x, y3, 'b') ;
leg1=legend(p,'Unit1A', 'Unit1B', 'Unit1C','Location','NorthEast');
ah1=axes('position',get(gca,'position'),'visible','off');
leg2=legend(ah1,p2,'Unit2A', 'Unit2B', 'Unit2C','Location','NorthWest');
Though I have put in the "Labels" as a part of the function, you could create a variable for the labels and use it in the function.
The legend fuction has more options you could tweak, which you can find in the following documentation:
Hope this helps!