why can't a machine be 100% efficient?

With the kid of "machines" we are used to, there is always some energy loss due to friction. This loss, however, could be made zero if nanotechnology is applied in a perfect vacuum.