Will getting a B in math [linear algebra at a college] as a prospective math major hurt my chances at top schools?

If it’s beyond Calc BC and you are in HS, it’s not going to impact your decision. If anything, it could help given the advanced level.