For Madrid it is specifically written that you have to intercept the localizer when receiving vectors and being on an intercept heading without having received the clearance to do so. To avoid interfering with the parallel approach.
For other airports: In theory, you need a clearance. But like zerozero said, every situation is different.
If ATC doesn't specifically instructs you to cross the LOC, I would use common sense, not to increase the workload of ATC by creating a dangerous situation with parallel approaches.