It's a reflex caused by synchronized contractions of the tail area (the meaty part that you eat) so shrimp can do it anywhere, but the resultant motion depends on the sweeping motion of their tail and swimmerets and only propels them backward. So in a net or out of water, they'll probably just flop around like fish, but once they wise up they can still walk around normally like an aquatic cockroach looking for a way to disappear forever.
They don't use it to escape from aquariums though, my shrimp spend most of their time swimming upside down at the surface and I've kept them in an uncovered aquarium for weeks without any problems... The times they do get out is when they accidentally shoot themselves out of the water when trying to escape my net or a hungry betta.
As for stopping them from escaping from nets, you can try catching them from behind :) they're relatively slow (betta-speed) swimmers in the forward direction. Also my betta poops in big spherical blobs and one of my amanos is clutching onto it like a pastry bun close to his mouth, slowly filtering tiny pieces inside... yum!