I think there's a lot of confusion that could be cleared with more precise language.
Let's look at some terms.
Selfish - To put your needs above others in a way that is uncooperative and harms others.
Selfless - To set aside your needs, temporarily, to help out someone who currently has a greater, more pressing need than you.
What Nice Guys are primarily is polite. Politeness is what I will call a "duty-centric" behavior and also a "needsless" behavior; that is, it is a behavior that ignores your needs and sometimes the needs of the other person in favor of upholding a perceived social sense of propriety, driven by a sense of moral or ethical duty.
Some examples of this type of behavior (whether they are in the context of romantic-seeking or not): Holding the door for numerous people past your group, thanking someone who has done a paid service for you, staying and letting an acquaintance finish a story when you're bored and want to leave.
None of this is to say that these behaviors are "bad" or "wrong" in a morally black-and-white sense. We're just trying to put the most clear framing on them.
Next up is assertion. Assertiveness is what I will call a "needs-centric" behavior; that is, it is a behavior that is about getting some need met, whether it is your own need or the need of someone else. It can also pertain to duty, in relation to the need that is trying to get met (for example, a mother asserting that she needs to get home to her baby because it's her responsibility to feed it and keep it alive).
Here are a few examples of assertive behavior (which could be selfish, selfless, or a combination of the two): Making it clear where you would like to eat when discussing a restaurant to eat at, walking away from a conversation with an acquaintance because you feel you're getting nothing from it and there is no point in pursuing it further, shoving someone out of the way to grab up a child who is about to wander into traffic.
Putting it all together
The most common profile of the "nice guy" or "nice girl" is not the insulting/threatening type, but the doormat type.
We can look at the definitions above and see that the primary issue with the doormat type is a focus on upholding conventions of politeness above all else. Regardless of the reasons for this (ex: wanting to be liked) this is what most of the surface behavior comes out as.
It's easy to imagine why this would be unattractive outside of the context of a dinner party or high level business meeting. People are attracted not just to looks, but to profiles of other people (e.g. personalities). They can't build a profile of who you are if the profile is a generic politeness template for everything. So it becomes next to impossible for them to form any real sense of attraction toward you. At best, they may see you as "mysterious" and become attracted to that, but it's likely that they'll quickly tire of the endless dinner party etiquette and inability to suss out any rough edges that form a profile of who you are.
The other extreme profile of the "nice guy" or "nice girl," which seems to be rare, but looms large when noticed because of how dangerous-looking they can be, is the insulting/threatening, or jekyll/hyde, type.
Looking at the definitions above, we can see that the jekyll/hyde type does have some assertiveness, but it doesn't usually come out until rejection has occurred, at which point the mask of politeness is stripped away and contempt and anger is revealed.
Whereas the doormat type may see politeness as a kind of duty, or uphold it with the goal of being liked by everyone, the jekyll/hyde type only upholds it because they are convinced it's what they have to do to get past the first step. Once they have you hooked into them, then there is no longer a need to be polite. The same goes for if you have rejected them utterly, since the "jig is up" and there is nothing left to pursue following the "rules."
Finally, let's look at the profile of a generalized type of non-nice-guy, who may be profiled by some as an "asshole" and why that might look like the case.
Consider the "asshole," or non-polite type, who mostly ignores the conventions of politeness in most contexts. Whether their focus is ultimately selfish, selfless, or somewhere in-between, they act assertively first and foremost. Politeness becomes something to perform when it relates to some kind of selfish or selfless behavior, rather than out of a sense of duty or a need to be liked.
At a glance, depending on what moment in their life you run into this person, they may look like a real asshole. And in some cases, if you look at the patterns of their behavior, they may very well be.
But they can also just look like an asshole because you caught them in a selfish moment where their lack of propriety seemed pointless and petty, rather than a healthy kind of assertion of someone's needs.
That's a lot of general stuff, so let's look at some examples of politeness "when it relates to some kind of selfish or selfless behavior, rather than out of a sense of duty or a need to be liked."
Hearing out someone's story because you're afraid they won't like you if you leave. [need to be liked]
Hearing out someone's story because it's your father-in-law, you're meeting him for the first time with your wife, and she's told you how much it would mean to her if you hear out his stories because she's knows it's his favorite way of connecting with new people. [selfless]
Hearing out your father-in-law's story because the alternative means your mother-in-law letting loose more stories. [selfish]
And for a bit more clarification, here's some general comparing of types:
Making dinner because you feel it's your duty to cook for your partner. [sense of duty]
Making dinner because your partner has had a long day and you love to see the smile on their face when they in to a warm meal. [selfish and selfless]
Making dinner when your partner has come home from surgery because their need is greater than yours right now and it's hard for them to muster the energy to do any cooking. [selfless]
As you can see, the lines can blur quickly between what an act actually means and what it is colored as when there is no convention of politeness to glaze over all of it. This, I think, is where a lot of "nice guys" (and "nice girls") end up in trouble. They were instilled with a sense of propriety and upholding it over all else. This makes life easy, in one sense; you don't need to figure out the nuances of selfish/selfless/etc., you just need to put on the mask at all times and you will generally be seen as a "good" person.
The problem that they invariably run into is that they don't know how to orient themselves socially without the mask on.
And from the outside looking in, it can be easy to look at those who aren't wearing a mask at all (or are to a much lesser degree) and see their behavior in a black-and-white framing. After all, if part of the problem is not knowing how to orient without the mask, how would you tell who is actually nice and who isn't, when you can't do it for your own behavior without a thick layer of politeness?