I don't have the textbook you've gotten this from, but unless there's a statement to the contrary, I suspect these are intended as examples of hydrogen bonding, rather than an exhaustive list of the only hydrogen bonding pattern which can exist.
If you start to look at real structures, you will see both "directions" of hydrogen bonding (hydroxyl donor/carbonyl acceptor and nitrogen donor/hydroxyl acceptor) in real protein structures.
Take, for example, the structure 1GKT. S297 is very clearly in a hydrogen bonding orientation with N303, with the hydrogen of the hydroxyl pointing toward the carboxylate oxygen of the asparagine. Also, Q22 is very likely in a sidechain-sidechain hydrogen bond with T29, where the hydrogen on the glutamate nitrogen is pointing toward the oxygen of the threonine.
If you spend some time looking at various experimental structures from the PDB website, you should be able to find examples of a wide range of hydrogen bonding patterns - basically, any acceptor and any donor can be paired, depending on the geometry of a particular protein.
One caveat I should mention here is that because of the way X-ray crystallography works, it's often difficult to tell which way the sidechains of the ASN and GLN residues are oriented. With electron density, the NH2 group and the =O group look very similar. Often it's a bit of guesswork on the crystallographer's part to tell which orientation they have, often relying on the layout of neighboring residues to determine the most likely hydrogen bonding network.
However, 1GKT was not determined by X-ray crystallography, but by neutron diffraction. In neutron diffraction it's very clear where the protons are located. (I picked a neutron diffraction structure as the example for this very purpose.) I also double checked that there wasn't any reason for flipping those particular ASN/GLN residues, both by manual visualization and with the MolProbity web server.