Hi there — The scrotum (ballsack) which holds your testicles can have a lot of variation from person to person. It doesn’t sound concerning to me that there seems to be a small indentation when they retract all the way back, particularly if it has always been this way.
HOWEVER, the fact that you are having pain makes me worried. Without knowing all the details, it is hard to know what’s going on so I think it is important to get checked out by your doctor. Anytime you have pain in your testicles you can’t easily explain, you should get your medical team involved.