There will be a few times when you go all-in early a hand (flop or earlier), find out you're a serious dog and end up losing. For example, you could go all in with KQ on a board of Q73 only to find out opponent has AA, AQ or 77 (and no one will be sympathetic for you). Or you can go all-in on the flop with a set of on a board of 345 only to see opponent turning over 67.

The question is, how do you separate bad play from bad luck (i.e. you console yourself by saying crap happens)?

Here is a list of possible flop situations:
Flush over flush
Flush over straight
Flush over set
Straight over straight
Straight over set
Set over set
Set vs Top 2
Set vs Big overpair
Trips vs Big overpair (KK vs 97, board 773)
Outkicked trips or house over trips (AJ vs J2 or 22, flop JJ2)
2-pairs over TPGK
Outkicked TP
KK losing to AA preflop
QQ losing to KK or AA preflop
AK losing to KK or AA preflop