Hummels, 27, will join Bayern on a five-year deal subject to a medical.
Bayern have paid Benfica €35m (£27.5m) for 18-year-old midfielder Sanches, who was also wanted by Manchester United, in a deal which could rise to €45m.
Carlo Ancelotti takes charge at the Allianz Arena this summer, when manager Pep Guardiola joins Manchester City.
Hummels started his career at Bayern, playing one Bundesliga match in 2007, before moving to Dortmund. His final appearance for Dortmund will be against Bayern in the German Cup final on Saturday, 21 May - if selected.
The clubs have agreed a "silence" over the fee.
Chief executive Karl-Heinz Rummenigge said: "Mats is one of the best central defender in the world. With him, we can increase the quality of our team again."
Portugal international Sanches, who had a medical on Monday, has also signed a five-year deal with Bayern, who won the German title for a record fourth year in a row this season.
Rummenigge added: "Renato is a dynamic, combative and technically gifted midfielder who will strengthen our team further."
German champions Bayern Munich have signed Borussia Dortmund defender Mats Hummels and Benfica midfielder Renato Sanches from the start of next season.