No, it is not possible to run OpenVZ containers inside Docker or vice versa.
OpenVZ and Docker use different containerization technologies and they cannot be nested within each other. Docker works at the operating system level and creates a container for its application and dependencies only. OpenVZ on the other hand, works at the kernel level and virtualizes the entire system.
Both of these systems manage resources like memory, CPU, disk I/O, network etc., but they do it in different ways. Trying to run one inside the other would lead to conflicts.
However, you can run Docker and OpenVZ side by side on the same system, as long as they are managing different sets of processes. You can also use tools like Virtuozzo, the commercial version of OpenVZ, which supports running Docker containers within its own containers. It’s important to note this doesn’t technically count as nesting, as Virtuozzo provides full virtualization, rather than the containerization provided by OpenVZ.