1984: BYU beats Pitt 20-14 on late drive (Pitt finished 3-7-1). BYU ekes by Hawaii 18-13 on late goal line stand (Hawaii finished 7-4). Cougs squeaked by Wyoming 41-38 (Wyoming finished 6-6). The following week they survived Air Force 30-25 (AFA finished 8-4, they were solid, and were NC contenders in 1985). Beat Utah 24-14, pulling away late (Utah finished 6-5-1). We all remember the 24-17 come from behind vs Michigan in the HB.
1996: BYU survives a barn burner at home vs aTm 41-37 (they finished 6-6). Cougs lost to Washington 17-29 (UW finished 9-3). The next week they barely survived New Mexico 17-14 (UNM finished 6-5). The rest of the season was pretty dominant until the WAC championship game, where BYU barely got by Wyoming 28-25 in Vegas (Wyoming finished 10-2). Beat a solid KSU team 19-15 in the CB. Again, 1 loss and several squeakers.
The 2004 Utah team was dominant in most of their games, but they were also blessed with an easy schedule, with 7-5 UNM, 7-5 aTm and 7-5 WY being the only teams with winning records on their regular season schedule. That schedule was full of patsies.
2008 Utah squeaked by Michigan (3-9) 25-23, Air Force (8-5) 30-23, only beat Weber by a score of 37-21, OSU (9-4) 31-28, UNM (4-8) 13-10 and TCU (11-2) 13-10. That undefeated season was full of squeakers.
Few teams go undefeated without a few ugly wins and/or some luck.