Yes shoulder pain can occur with a heart attack but just having shoulder pain doesn't always mean a heart attack.
When having a heart attack you should feel chest pain, a tightening of the chest and your arms or arm may go numb.
If you do feel like you're having a heart attack and you're not sure it's an actual heart attack, go ahead and call 911 and get an ambulance out anyway.
It's better to be safe than sorry. When having a heart attack those seconds matter and getting you to the hospital is critical in saving your life.