The 24-year-old Spain international joined Barcelona from Valencia in 2016 for 30m euros (£27.3m) but failed to establish himself in the side.
Dortmund announced the signing with a Tinder-style video announcement on Twitter.
"I'm really looking forward to playing for Dortmund and their incredible fans," said Alcacer.
Dortmund said that they have an option to buy Alcacer for 25m euros (£22.7m) at the end of the season.
"At Barcelona, he worked daily with some of the best players in the world," Dortmund sports director Michael Zorc said.
"It is due to the extreme competition among the club's forwards that he has now decided to take a fresh start after two years."