can you work in several fields as a mechanical engineer
If you want to do petroleum engineering, major in petroleum engineering. There is no need for a geology degree if you want to do engineering. Mechanical engineering is the jack of all trades, master of none discipline. It can be used for many fields, including petroleum engineering. If you don't want to major in petroleum engineering, chemical engineering is probably closer than mechanical for what you want to do.