An irreducible representation is real or quaternionic precisely when its character is real-valued. By the Peter-Weyl theorem all characters are real-valued precisely when every element in the group is conjugate to its inverse. When the group is connected a more precise answer is as follows: The Weyl group (in its tautological representation) must contain multiplication by $-1$ and this is true precisely when all indecomposable root system factors have that property. I don't remember off hand which indecomposable root systems have this property but it is of course well known (type A is out, type B/C is in, type D depends on the parity of the rank).
Addendum: Found the relevant places in Bourbaki. All representations are realvalued precisely when the element he calls $w_0$ is $-1$ (Ch. VIII,Prop. 7.5.11) and one can also read off if a given representation is real or quaternionic (loc. cit. Prop 12). From the tables in Chapter 6 one gets that $w_0=-1$ precisely for $A_1$, B/C, D for even rank, $E_7$, $E_8$, $F_4$ and $G_2$.