Yes, you can use a cold pack wrapped in a towel for up to 30 minutes. Do not fall asleep with the shoulder iced, though. And while icing can help make you comfortable enough to go to sleep easier, over-the-counter pain medications are super important. Try to time those so you have maximum relief (an hour or after taking) when you will be trying to fall asleep.
Another option, while a bit expensive, is a cryocuff or iceman, which are readily available online. These are like a special ice pack for your shoulder, and deliver numbing pain relief to all areas around your shoulder. You may need a little bit of help to use this regularly. However, these are almost essential if you do not wish to take pain medications for whatever reason. There are also several cooling machines available now that you are able to use all night while sleeping.