The centre-back, 22, who has put pen to paper on a five-year deal at the Signal Iduna Park, follows Marwin Hitz (Augsburg), Marius Wolf (Eintracht Frankfurt) and Thomas Delaney (Werder Bremen) to Dortmund, who have also brought in a new coach, Lucien Favre.
"After getting to know the Bundesliga in Mainz, I'm looking forward to the challenge of being able to prove myself at a club as big as Borussia Dortmund in the future," Diallo told Dortmund's club website. "Together with my team-mates I want to pay back the trust placed in me and contribute to BVB achieving its aims in every competition. I can't wait to get started with preparation for the new season under Lucien Favre."
BVB sporting director Michael Zorc added that "he's a modern, intelligent defender, capable on the ball. He can play wide or in holding midfield and it was the combination of his potential and versatility that really caught our eye."
The defender, who also drew interest from Arsenal, made 27 top-flight outings in his only season in Mainz, scoring two goals.
Watch: Diallo found the net on Matchday 3 last season in Mainz's 3-1 win against Bayer Leverkusen!