Is there any way to set pixel values of background to 0 when rendering?
As @no-can-do mentioned in the comments, you would have to go in the world part of the shader editor.
If you want to keep your environment light you can use a setting like the following.
&quot;Is camera ray&quot; will drive the background color.
If it is a ray from the camera (rendered), the value is 1 and the &quot;mix color&quot; will give black.
If it is not the value is 0, the ray will be from the texture and will light the scene.

Note: if you're not using accurate texture format (openEXR), you may have rounded RGB values (i.e: 0.000something becomes 1).