It does matter for derailleur setups. A potential consequence of getting the wrong chainline by mix and match is the front mech no longer works properly (due to clash with frame or run out of reach). Front mechs are designed to work best with chainsets having the chainline they are designed for, there are exceptions but most road double are 43.5mm, road triple 45mm and mtb/hybrid 47.5mm or 50mm.
For road HT2 chainsets there is not much you can do to adjust the chainline. For mtb ones they come with spacers which allow a little flexibility.