As the question is pointing out, because of Earth's thick atmosphere we have quite a bright sky, and so we can not easily see stars during the day. So how can we talk about the position of the Sun with respect to the stars if the stars around the Sun can't be seen?
By using star charts, and the very steady and well known rotation speed of the Earth (360 degrees in about 23 hours, 56 minutes, 4 seconds) ancient (and modern) astronomers can calculate where the Sun is with respect to the stars. Before the invention of telescopes, astronomers had a huge amount of time on their hand with nothing better to do than these kinds of calculations, so they got quite good at it.
After a century of measuring the positions of all the planets using both optical telescopes and radar reflection timings and round-trip signal delays from distant spacecraft, orbiters, and landers, and calculating masses and orbits to extremely high precision, the locations of the Sun and all the planets are known to a handful of kilometer accuracy. The Moon's position is known to centimeters!
With this, one can predict with computers where the Sun is with respect to the stars.
From space, in orbit above the Earth or in orbits around the Sun, spacecraft can indeed see the stars and the Sun at the same time! Even telescopes on balloons or aircraft high in the atmosphere can do this.
Here is a cool GIF I made of images taken by the SOHO spacecraft. You can see stars, comets, the planet Venus (the really bright object) very close to the Sun, and even the Pleiades pass over the top of the Sun!
From this answer:
These LASCO C3 images from SOHO were downloaded sohodata.nascom.nasa.gov/cgi-bin/data_query. The square frame is about 15.9 degrees wide.