You might be able to use your native remote if it's infrared and LIRC supports it, and you get a little USB IR receiver dongle: https://www.lirc.org/
Or what I like is to get a generic air mouse/keyboard remote that has programmable IR buttons for volume, input select, power on, etc. to control the TV's native settings. There are a ton of inexpensive options: https://www.amazon.com/air-mouse-remote-keyboard/s?k=air+mou...
I use LibreElec on a Raspberry Pi 4 and it already supports receiving remote control messages from the TV. So if you hit the play button on your remote, your TV's IR receiver will pick it up, then pass the signal to the Raspberry Pi over the HDMI cable.
Is there a bit of commonality for remote button frequencies? I have 3 different remotes for TV equipment plus my AppleTV remote. The volume buttons from all 4 remotes work, and I've never attempted to program/train/learn them.
There isn't really. Most manufacturers have multiple sets of patterns.
There are smart remotes with libraries of patterns and capable of switching between those, eg Logitech Harmony (assuming that's still a thing).
There are also "learning" remotes. One of these would be easiest to homebrew. Basically you've got an IR detector. You point your existing remote at it and tell it to start watching for whatever button you want to map. Then you press that button on your existing remote. Voila, key mapped. You just have to keep doing that for all the zillion and a half buttons on your remote and you've got yourself a clone.
Yeah most use a 38khz pulse wave and then encode ones and zeros in it. There are tons of different brand-specific protocols for stuff like volume, power, etc. but you're right there is a lot of overlap and commonality. Some universal remotes just fire as many different brand signals on button press as possible.