You need to delete the file on another subdomain on the same server. That is, the php-delete script is called on one subdomain (dom1.site.ru), and the file is on the other.
The following thing indicating the full server path did not help:
unlink("/var/www/user/data/www/dom2.site.ru/img/1.jpg"); How to be?