The Italian champions were frustrated by their Czech opponents in the first-half, but goals after the break from Zlatan Ibrahimovic and Antonio Cassano sealed the Group H win for them.
Speaking after the match, Allegri admitted his side could have done better in the game and that Ibrahimovic's return from injury was a boost.
"We started the game pretty well and tried to play some good football, but still allowed Viktoria some counterattacks," he was quoted as saying in UEFA.com.
"Our first goal made things easier for us when it came in the second half. In the last month I've had to stick to the same players as others have been injured, so Zlatan Ibrahimović's recovery was vital for us.
"We played better in the second half when we started to push down the wings, leading to several chances, but after the second goal we relaxed too much and obviously took a few risks."
The win puts Milan level on four points with Barcelona in Group H. And Allegri dedicated the victory to club president Silvio Berlusconi while switching his atttention to the next Serie A game against Juventus.
He added: "Now we have a couple of days to recover before starting to think about the next game [against Juventus]. Tonight's win is dedicated to our president [Silvio Berlusconi], who turns 75 tomorrow [Thursday]."