The BUK is a radar seeking missile. In much the same way a heat seeking missile targets the engines a BUK goes for where the radar emissions from its target are strongest. On a passenger plane the main radar dome is in the nose of the aircraft just in front of where the pilots sit.
When its warhead explodes a huge cloud of high speed shrapnel is ejected and the target aircraft is shredded in the vicinity of the radar dome which therefore includes the cockpit.
Wikipedia describes it thus:
" A proximity fuse aboard the missile determines when it will detonate, creating an expanding fragmentation pattern of missile components and warhead to intercept and destroy the target."