The Eagles will get draft compensation, and the trade will go through later this week after the NFL's new league year begins.
Both linebacker Alonso and cornerback Maxwell were additions made by former Eagles head coach Chip Kelly, who was fired late in the 2015-16 season. Philadelphia hired Doug Pederson to replace Kelly, and Pederson moved on from the two players.
Maxwell was the Eagles' big free-agent signing last season but struggled in his role as No. 1 cornerback. He agreed to a six-year, $63 million contract, but was inconsistent in coverage and recorded just two interceptions and 64 tackles.
Alonso battled through injuries and had a career-low 43 tackles and one interception in 11 games last season. He is a former second-round pick of the Buffalo Bills.
The Dolphins were ranked 25th in total defense last season and struggled against both the run and pass.