I think the idea that Anakin is the best duelist comes from stunt coordinator Nick Gillard who organized the skills of the various characters into tiers although it has been inconsistent between interviews.
In 2011, there are 9 tiers with tier 8 was reserved for Yoda, Windu, and Sidious. The other great swordsmen are tier 7 and Anakin is above them at tier 9.
In 2005, this is changed to Yoda, Sidious, and Anakin on tier 9, Windu is between 8 and 9, and other great swordsmen are 8.
I. Gillard's Tiering is ValidHoming Beacon #126, Dec 22, 2004:How does one quantify fighting prowess, and does such a quantity have any practical valu
comicvine.gamespot.com
The intention is Anakin is very skilled and arguably has the potential to be the definitive best duelist and force user in Star Wars due to being the one and tapping into the darkside but its not always guaranteed that a higher tier beats a lower tier due to external circumstances.
Anakin was still a padawan and reckless when facing Dooku who is one of the most skilled duelists so losing makes sense and he beats him in ep 3 (showing that Anakin has improved).
In terms of losing to Obi Wan, I believe the idea was since Obi Wan trained and was by Anakin's side the longest, he knows Anakin's moves and fighting style the best. Even then, most of the fight was Obi Wan defending and getting pushed and it isnt until Anakin tries to beat Obi Wan with his own move (jumping like Obi Wan did to take down Maul) that Anakin loses.