Stars are dim. We can only see them if our eyes are adapted for low light. Astronauts in space can see the stars when the sun is blocked from view and avoid seeing any large sunlit objects.
Some astronauts said they did not notice the stars, but others claim they could see them. Flat-Earthers use the conflicting statements to discredit spaceflight. In reality, sometimes astronauts can see the stars, and sometimes cannot, just like us on the ground, depending on the situation.