Can I substitute salts 1:1 by weight? In a recipe where you’re dissolving salt in water or a similar mixture(not sprinkling it as a seasoning, etc.) is it possible to substitute, for example, 1 gram of kosher salt with 1 gram of table salt?

I understand that you can’t do this by volume, but if both salts are mostly NaCl and I’m going by mass, then they should be close to equivalent, right?
Yes. In general diamond crystal kosher salt requires about twice the amount (by volume) as table salt, but measuring by weight is best and works with any salt.