No pain, no gain is simply not true for someone, HIGHLIGHT for a beginner. You shouldn't ever push your body to do things it isn't regulated to do. Especially when it gives you warnings by showing physical strain and pain. There are limits to everything and anything. When your body shows pain, it shows warnings about possible or evidential injuries or hurt. It's not a good idea to send your body on an overdrive when it's obviously screaming out to you about it's uncomfortable stance.
While it's good to get your body regulated and use to physical activities, you should push your body tittering on edge. It takes time to get use to things and you will be sore. So in a sense, yes, pain kind of a notation if what you are doing causes a strain. This shows you what areas you need to work and take precaution in.