The short answer is yes, it could have an impact.
USNA does not subscribe to the view that, if you are an "average" student at a "competitive" high school, you would certainly be an "outstanding" student at an "average" high school. They also aren't saying that wouldn't happen, just that they don't make the assumption.
I have a super competitive high school in my BGO territory. Candidates who don't stand high in their class have had some issues obtaining appointments and the reason, according to USNA, was their class rank -- which is of course directly related to how well they do in their classes.
This is one of the reasons USNA looks at your SAT/ACT scores. If you have really high scores and are ranked somewhat low in your class, they may conclude you aren't working to your full potential and that could be a problem. And, it allows them to compare you with others in the country who have similar scores and are also at competitive high schools.
Also, USNA generally knows which schools are competitive and which are not and certainly will take some note of this. Finally, this is why USNA considers the "whole person." They will look at what your teachers say about you, what you do outside of the classroom, what classes you've taken, etc.
Bottom line: class rank is very important to USNA but it is not the end all and be all.