The former Barcelona coach will replace Jupp Heynckes as the German club's coach at the end of the season.
"I was surprised because I didn't see it coming," Ferguson told reporters. "All the time the talk was about clubs in England.
"But if you assess it as a coach, if you're given the opportunity to manage Bayern Munich it is hard to turn down because they are probably one of the best-run clubs in Europe.
"A fantastic city, a fantastic stadium, good players, good history. It is very easy to choose Bayern Munich with all these circumstances."
Guardiola stepped down as the Barcelona coach at the end of last season after four years at Camp Nou.