It would be more appropriate to determine the thesis topic at the beginning of the master's education. Later on, it will be beneficial for you to work on this subject during your master's education.
There are several fields to which you can research on; Enhanced Oil recovery, Petroleum production Optimization, Well control Optimization, Well placement optimization, Intelligent Fields Production Prediction, IOT based petroleum production etc to name a few. It's also important to identify gaps in research fields. That will give you a heads up on your aim in choosing a particular field.