Hi donna, yes an ultrasound can detect a hernia but it's not very good for appendix.
Usually people drink water to fill up the bladder which then in turn pushes all the other bits out of the way so the sonographer can get a good look what's inside. On the contrary for a look at the gallbladder it's usually recommended that you do not eat or drink anything for four hours so that the gall bladder is not contracted.
A simple answer to your questions is that ultrasound can detect, fluid, cysts, fibroids masses and stones, it is not however 100%, but because it is non invasive and relatively quick it is usually the first port of call for investigations. If it continues then I am guessing that a trip back to the doc is in order.
The trouble with abdo/tummy pain is that it really can be a multitude of things such as IBS, CROHNS which are all bowel related but the pain feels like it's going on somewhere else. Anyway I hope this has cleared up a bit of the mystery and you get sorted soon.
fuzzy x