Both are Os virtualization - software defined virtualization. All hosted virtual instances are run by a single operating OS kernel. This means there is no flexibility for the clients to run the OS they need.
Well in terms of virtualization you can not really differentiate between OpenVz and Docker , Docker is way advanced than OpenVz. OpenVz is to just virtualize a dedicated server , where as Docker has a virtualization concept however its an automation thing which helps you to deploy the virtual instances with installed apps using either docker community image or free image. Docker has to 2 versions , one of them is PAID version however their free edition is way advanced too. Docker is basically used to deploy and host the application instances which has pre-defined configurations and it is mostly used to develop apps as it provides easy administration , updates , changes for such apps.
@24x7CSM is totally right, there is no reason to compare OpenVZ and Docker because their features and possible usages are not the same.
OpenVZ is a container virtualization solution, similar to LXC/LXD, which provide the ability to host several isolated containers running a full linux distribution on the same host.
Main usage : providing virtual servers hosting on dedicated servers with isolated containers
When Docker is a lightweight container virtualization solution built "to develop, deploy, and run applications with containers" like Docker.com explain it in its documentation. Docker cannot be used (isn't intended) to run a full linux distribution in a container, but only a single application.
Main usage : running applications inside containers on almost all platform to isolate each service inside a container (most of time, Docker containers are running inside virtual machines powered by KVM, XEN, or VMWARE)