How to lock object face a certain distance away from another object face?
Set object2 origin point to its right bottom corner and you are free to scale in object mode.

Select object2, go to edit mode, select right bottom vertex, Shift+S > Cursor to selected.
Return to object mode Shift+Ctrl+Alt+C > Origin to 3D cursor.