Do video containers influence the video quality?
The choice of container has no bearing on stream quality, which is determined solely by encoder parameters.

What may happen is that the stream could have non-standard or at least unexpected colorimetry properties and some containers can't store that metadata or may have stored them incorrectly. Also possible is that the metadata is correct but the player doesn't parse them correctly or at all depending on the container. This can lead to a difference in rendering, which you perceive as a change in quality.