Sure, and the reason we use music in this way is often to keep us motivated, to keep us focused on what we are doing by distracting us from the pain it is causing, or to keep us from being distracted by the things around us. I have earbuds in for my runs because otherwise I would notice that running hurts.
Having music playing in the background (say, for warmups) can complement your work in hockey, but if it's so loud that you are not aware of what else is going on - in a sport where communication is actually essential - it is working against you.
Workouts - with weights, for example or in running - are essentially solo activities. Hockey is a team game. You are working in sync with your teammates, and you can't if you are going out of your way to isolate yourself. Even goalies need to be part of the team, and as a former goalie I can't believe I have to say that.
This discussion, man.