You can refuel from some white / blue stars - particularly A and O and F class ones.
You cannot refuel from L class red dwarfs (the very red small stars) or T Tauri stars, which come in orange, yellow, and white varieties. Nor can you fuel from white dwarfs (very, very, very hot) or neutron stars (obviously.)
The mnemonic 'Oh be a fine girl, kiss me!' helps you remember the main sequence star types (OBAFGKM) which are scoopable. You can see the class of the stars in a system from the info page in the galaxy map, even for unexplored systems.
Edit: And if you get yourself trapped in a system with no scoopable stars and you ca'n't jump out, you're dead. Self destruct and take the lesson home with you for the next trip! And don't feel bad, it happens to everyone at least once.