Yes. The server's distance changes your ping for certain, and it can change the download number when the path between you and that server is the slow part. A test against a server across an ocean is not a test of the cable into your house.
This test does not ask you to pick a city. The browser talks to Cloudflare's speed-test network, which routes you to a nearby Cloudflare location. The bytes still cross your real connection. They do not loop inside the computer, and they do not stop at this website's host. A result is the path from you to that nearby location, not a tour of a distant country.
Ping moves first
Ping is mostly distance plus equipment. A server 20 ms away cannot produce a 5 ms ping, no matter the plan. What is a good ping only makes sense against a reasonably close server. Judging a game by a speed test aimed at another continent will scare you for no reason, and it will not predict a game server that sits in your region.
Download speed is less sensitive until the path is long or congested. Two nearby servers can still disagree by a little, because they are not the same network. Why speed tests show different results is that comparison. How accurate speed tests are is what a single run can and cannot claim.
How to get a number you can repeat
Use one test, twice, on Ethernet, with the house quiet. That pair is your line to a nearby well-connected server. Run the speed test that way before you open a second site "to confirm." If the two runs on this test agree and a second site aimed at a far city does not, believe the nearby pair for the plan, and believe the far test only as a test of that far path.
How to read a speed test keeps the four numbers straight once the server is no longer the variable. If you are collecting evidence for a provider, write down that the test was to a nearby Cloudflare location over Ethernet. A screenshot of a transoceanic server will not match the line they sold you.
Common questions
Should I pick a server in another country to see my real speed?
No. A far server adds distance and extra networks. The useful test of a home plan is a nearby, well-connected server.
Why do two speed tests disagree?
Different servers, different moments, and different paths. Compare two runs of the same test before you compare two brands.