like if they were friends and flirting all the time but the guy doesn't think much of himself as goodlooking,
Most Helpful Guy
Flirting means nothing, people do it for fun. If they are friends, all the more so -- it means you're "safe" to flirt and have fun with, but anything more than that is a no-no. Try to cross the line and you get bounced right back. See it all the time...
To answer your title question, absolutely yes. a 4/10 guy wouldn't have much of a chance asking a 9/10 girl out, so he doesn't. Sure, he may be a believer of the "everyone has a shot with everyone" BS, in which case he'll be collecting rejections left and right until he realizes "oh maybe that's not how it works."
This kind of thing happens a lot. Even how you said a guy can be friends and be flirting with you, this flirting could very well be doing it and not even thinking about it or harmless fun. But when it comes to actually making a move on you, he might not feel "good enough" to be with you so he never tries.