Since certain chemicals react well together, we can use that image to describe how people interact well. They are the right "chemicals": they have "chemistry".
So you could use it for any relationship - mainly men+women, but also friends and perhaps family members. A pair of movie actors who perform well together are described as having "on-screen chemistry".
An alternative is "dynamic"(as a noun), which is normally used for groups. "Our household has a good dynamic", meaning you all work well together, and there's a good active energy between everyone. Someone moving out, or a new person moving in could change or disrupt the "dynamic".