Can someone explain to me how Docker works in EEv4

According to this, nothing is installed. Are the sites created independent from the OS packages? Like PHP, Nginx, etc.? If so, is it safe to remove those packages?