Can an endoscopy detect a hernia? Specifically an umbilical hernia?

Unlikely. An umbilical hernia occurs when there is either fat/soft tissue/bowel that is caught in the underside of the umbilicus (navel). Typically this is seen with imaging such as a CT scan, not with endoscopy.