About 3 years ago I had a vasectomy. Not long after I began (and continue to) have discomfort around the sides of my hips. Can this be related?

Not likely. A vasectomy is a simple surgical procedure done through the skin of the scrotum. There should not be any new symptoms related to it several years later. For hip symptoms, one can see his primary care doctor first, who can evaluate for the common hip problems; and then refer to other specialists if needed, such as to orthopedic, rheumatologic, gastro-intestinal, urologic, or cancer doctors.