It's not a reliable indicator of ancestry, no. It can sometimes give you a few pointers, but the only reliable way of discovering your ancestry is to trace back in the records, one generation at a time.
Of course, you have to use a bit of common sense here e.g. someone with a surname like Czarniewski almost certainly has some Polish or other Slavic/Central European ancestry and it's pedantry to insist they don't.
What you have to consider, however, are the following things:
1. People sometimes adopt a surname that wasn't originally their family's e.g. children of a single mother who remarries sometimes take their stepfather's name and children who are adopted usually take their adopted parents' name - their descendants will thus have a surname which does not reflect their blood ancestry, at all. Similarly, many African Americans have a European surname which their ancestors were given by slave owners - useless in establishing their ancestry. Or people change their name by deed poll etc.
2. Immigrants often change their name, or at least the spelling of it, to fit in with their new culture more. e.g. a Russian Jewish immigrant to the UK or US might have changed their name from Horovitz to Hewitt or Levi to Lewis. A Danish immigrant called Jansen might change their name to Johnson, to make it more American. And so on. Their descendants will thus find their surname very misleading as an indicator of ancestry.
Occasionally this happens the other way, with people with a very English-sounding name changing it to make it sound more exotic (e.g. the 18th century novelist Daniel Defoe was originally called Daniel Foe, but he added the De- to make it sound more French and unusual)
3. Spelling was less fixed in the past than it was now and a surname can sound like it comes from one language when it doesn't.
4. Surnames can (coincidentally or because of shared linguistic roots a long way back) exist in two cultures simultaneously - the example everyone usually cites is Lee being both an English and a Chinese name, but Miller is a common surname in both the UK and Poland and there are many other examples.
Also, many people lazily assume that an -ov name must be Russian or a -ski name must be Polish, but names with these endings can usually have come from any of the Slavic countries, so if you have one of these names, your family could have come from Russia, Poland, Slovakia, the Czech Republic, Ukraine, Bulgaria, Serbia, Croatia etc, etc. Spelling is little help in distinguishing between e.g. Russian and Polish names, as (a) spelling was less fixed in earlier centuries (b) immigrants often change or simplify the spelling of their name (c) Russians don't use the Roman alphabet, anyway, so it's a matter of personal choice whether you spell the Russian name Stanislavski, Stanislavsky, Stanislavskiy, Stanislawski etc.
5. Borders of countries change, people move around and some countries have substantial ethnic minorities, particularly around border areas, so just because your family has a German name, it doesn't necessarily mean that they came from what we think of as modern Germany.
6. Surnames are normally handed down in the direct paternal line, so only indicate a very small part of your ancestry. Even if your surname accurately reflects your father's paternal ancestry, it won't indicate anything about the rest of his ancestors, e.g. his mother's ancestry, the ancestry of his paternal grandmother, paternal great-grandmothers, great-great-grandmothers etc. and nothing at all about your mother's ancestry.
Many people in England have French surnames, some of which came over with the Norman Conquest, some of which came with the Huguenot refugees in the 16th and 17th centuries and some of which are Frenchified spellings of totally English names (see note on Daniel Defoe above). A French-derived surname like Devereux or Prideaux might technically indicate an ancestor who came over from France in the 11th century, but it still wouldn't change the fact that about 99% of your ancestry was English. And the Normans who came over after 1066 were largely of Scandinavian ancestry, anyway, so it would be misleading to think of your family as "French" in any meaningful sense.
A really good example of how surnames can be misleading was featured in the British version of the TV programme Who Do You Think You Are? The actor Alistair McGowan had always assumed from his name that he was of Scottish descent on his father's side. In fact, when he went back in the records, he found that his father was descended from a soldier from Ireland (not Scotland!) who had settled in India in the 18th century and married an Indian woman and that his ancestry on his father's side was thus abut 75% Indian, with no Scottish at all.