How can I test my house water supply for hydrocarbon presence?
Chances are you do not have presences of fuel in your water. This sounds like you could have a few different things happening.
First off, iron reducing bacteria can lead to significant corrosion. These are bacteria that feed on iron both in the water and also in plumbing systems. They also can put off a smell.
The second one is manganese. If you notice this smell after rain, etc. then this is a possibility. Manganese can make the water blackish and smell like fuel oil. While mostly harmless, it can cause issues with staining, etc.
If you have a private well and live in a hard water area, both of these could be occurring simultaneously. Correlation is not always causation. What the smell is vs. what is causing the corrosion could be separate issues.
Lastly, if the pH is off in the water, too acidic or too base then this can also eat away at your pipes. Typically though, many water quality smell and plumbing issues come from bacterial issues. Check this first and then move on if negative.