I believe that model most likely used the dreaded butterfly key mechanism. If the butterfly mechanism is damaged, then the whole Top Case/Keyboard Assembly will need to be replaced.
If only the key cap is damaged, then it should be possible to have Apple or an Apple Authorized Service Provider replace the key cap. However, Apple only has a complete key cap kit set so the price of a single key cap may be quite expensive (not as expensive as replacing the entire Top Case/Keyboard Assembly).
If it uses a scissor mechanism and the scissor is damaged, then Apple does have a replacement scissor kit....again a complete set, so it may be pricey.
If the key switch or mount within the key bay is damaged, then the whole Top Case/Keyboard Assembly needs to be replaced (both scissor and butterfly mechanisms).
If neither the butterfly/scissor mechanism or key cap is damaged, then they can certainly pop the key cap back on...however, I find usually something is damaged from people attempting to pop it back on themselves or using the broken key without reattaching it.
Unfortunately I have never heard of anyone on this forum having an Apple Store or an AASP to replace a broken key cap or scissor mechanism....I don't think the techs are aware Apple has these parts kits available. And I don't think an Apple Store does this type of repair other than perhaps popping the key cap back on.
There are online vendors who do sell replacement key caps and scissor mechanisms....some even sell a butterfly kit, but the butterfly mechanism is too difficult to install. Apple has several variations of the key caps in addition to all the regional variations so it is not that easy to identify the exact key cap needed.
Personally I would not spend any money on repairs to any 2016-2020 Intel Mac with USB-C ports for multiple reasons. If you can get the key cap back on or replaced for a small fee...that is fine, but if you need to have the entire Top Case/Keyboard Assembly replaced, then I would highly recommend considering putting the money spent on repairs into a new laptop. Keep in mind the battery on this laptop is probably going to need replaced soon since most Lithium Batteries fail between 3 - 5 years (according to Apple's website an official battery replacement is $159US).