I grind my head into my opponent's face when I'm stuck in a tight rubber guard. My goal is to distract my opponent so that they can not analyze my defense at their leisure while I attempt find some wiggle room. Also, I intend to make them uncomfortable. I do this to Eddie and he has never complained. It wears on an opponent psychologically and encourages them to transition to a position where I will have more freedom of movement. It is hard to attack while another head is pushing down into yours.
In regards to "pains moves" as a whole, it is better to see these moves from a teammate than to learn they exist in the middle of a tournament. I do not encourage my students to use pain moves, other than the grinding their head into their opponent's face. Personally, I do not like to use things like the knuckle in the throat move but I deal with it when it happens.
On the other hand, there are times when pain is inflicted to open your opponent up. For instance, if your opponent has a great kimura defense, you can drop your elbow into their ribs and they usually let go of their defense. Or if you have mount and your partner has a great T-Rex, then you might want to push your forearm into their throat so their arms will come out so you can attack them.
Whenever I show them a pain move, I point out to my students that if they go there, their competitor will likely respond in kind; so save dick moves for when you need to punish someone for using dick moves on you. Or because you need to open your opponent up.