I am planning a week vacation at the end of august, since I am a EU citizen I would like to know if visiting Qatar, Bahrain and Dubai will make me ineligible for an ESTA and therefore for a trip to USA later
The US State Department says:
Visa Waiver Program Improvement and Terrorist Travel Prevention Act of 2015
Under the Visa Waiver Program Improvement and Terrorist Travel Prevention Act of 2015, travelers in the following categories must obtain a visa prior to traveling to the United States as they are no longer eligible to travel under the Visa Waiver Program (VWP):
Nationals of VWP countries who have traveled to or been present in Iran, Iraq, Libya, Somalia, Sudan, Syria, or Yemen on or after March 1, 2011 (with limited exceptions for travel for diplomatic or military purposes in the service of a VWP country).
Nationals of VWP countries who are also nationals of Iran, Iraq, Sudan, or Syria.
Qatar, Bahrain and Dubai are fine. Indeed, all three are very close allies of the US: the US has a huge air base in Qatar , a large naval base in Bahrain and a customs pre-clearance station in the UAE.