They can be. Many people find U-shaped neck pillows uncomfortable or unhelpful, but a neck pillow that provides enough support may help hold your head upright while you sleep and prevent it from flopping into an uncomfortable position. Experiment with different pillows to find one that works for you.
Neck pillows are smaller and more convenient than body pillows. However, body pillows are typically more comfortable and cater more specifically to certain sleep needs, such as needing to sleep leaning forward.