The Bills had extended their scoring streak to three straight drives with connecting with Diggs on 11-yard pass in the middle of the field.
Allen connected with wide receiver Gabe Davis on an 18-yard touchdown pass on the opening drive of the game.
The scored ended an eight-play, 75-yard drive that saw the Bills go down the field with ease. The drive took four minutes off the clock. Allen connected with Davis as he streaked down the right sideline with cornerback Justin Bethel in coverage.
Davis scored a TD for the third straight game, tied for the longest streak of his career. The score was set up by an unnecessary roughness penalty called on Dolphins cornerback Kader Kohou for pushing Diggs out of bounds at the end of a 17-yard reception.
Running back James Cook also scored his first touchdown of the season.
Cook, who is not typically the Bills' short-yardage back, received the handoff one-yard out and almost lost control of the football, but held on and pushed his away forward past the goal line. The touchdown was reviewed, but ultimately upheld, ending a long 10-play, 80-drive by Buffalo.