I had an inguinal hernia surgery 3 years back. I feel pain in surgical side whenever I ejaculate. No recurrence. How can I find if repair is damaged?

Probably scar tissue. The testicle obtains its blood supply and drains the sperm thru the spermatic cord, that runs through the inguinal canal, which is mobilized as part of the hernia repair. The pain during ejaculation is likely due to some scar tissue around the spermatic cord as part of the hernia repair and is not likely due to hernia recurrence. If very symptomatic, reoperation may be necessary.
Hernia recurrence. Unfortunately pain years after a hernia repair in the groin does occur. First a recurrence of hernia should be ruled out. If physical exam is negative for hernia, then a dynamic us of the abdominal wall is useful, low risk, low cost imaging. If us is negative, then injections with a pain specialist can both help and provide diagnostic information. Mri is not incorrect, but also not likely to help.