It can, but scanning at rest, on coughing or straining, and standing makes it much less likely. A very small or intermittent hernia may not protrude on the day, and a hernia deep in the abdomen can be harder to see. Scanning at rest, on coughing or straining, and standing gives the best chance of showing it.
If nothing appears under full provocation, that is a documented result, and the same appointment checks for other causes of a lump. If symptoms continue, your report may suggest a follow-up scan, a GP examination or another test.