Sending audio in via the TV and taking it out via either ARC or Optical can limit some of the sound format options. Whether this is a concern for you rather depends on the sources and what you'll accept as surround sound.
You're looking for a used AV receiver, so lets talk about that first.
AV receivers have supported HD audio in the form of Dolby True HD and DTS Master Audio for more than 10 years. But in order to get that sound from a source (usually a Blu-ray player) required something better than an
Optical or Coaxial audio connection. The amount of data they can carry is limited, so it means that the most you'll get from Optical or Coaxial is Dolby Digital or DTS. They won't carry HD audio. For that, in most cases you need a HDMI connection when connecting a Blu-ray player or other source capable of HD audio such as a games console or streamer box.
What about TVs with HDMI ARC then?
ARC is the same as using Optical or Coaxial. It is capable of carrying a maximum of DD or DTS in 5.1, or digital stereo (PCM 2.0). That's your lot. It won't do HD audio or any of the more immersive audio formats such as Dolby ATMOS or DTS-X.
There is an updated version of ARC that will do the higher resolution and immersive formats. It is called eARC. The TV and the AV receiver both have to be eARC compatible for this to work. eARC is only just starting to filter through on higher-end products. It will be quite some time before it's universal (if at all?), and even longer before eARC capable AV receivers are widely available in the used market.
Whether I connect from the TV by ARC or Optical, I'll always get DD 5.1 and DTS 5.1, right?
Not quite. It depends on the TV.
How a TV handles audio from its Freeview HD tuner, USB connection and internal apps can be different from what it does when passing through the sound from its HDMI inputs. Dolby Digital is pretty-well supported, particularly on TVs with a Freeview HD tuner. DTS is less so. Some TVs pass it in up to 5.1. Others are limited to stereo only for DTS. Other TVs ignore it completely. The best thing to do is check the documentation for your specific model of TV, and even then the answers may not be that clear. Manufacturers hate to admit there's a shortcoming in their products, so you may well find that they talk about DTS without mentioning that it's limited to 2 channel, or that DTS only applies to say the streaming apps but not the HDMI inputs.