Which prerequisites does the process need to fulfill to be "attachable"?
I'm pretty sure it depends on the underlying technology- how the particular debugger service works- what its protocol is, which ends up determining how the extension that communicates with that debugging service works, and translates information about it to VS Code's debugger API. For full info on the topic, see the VS Code Debugger Extension Development docs. Here's a high-level diagram from that page:

And a quote:
VS Code implements a generic (language-agnostic) debugger UI based on an abstract protocol that we've introduced to communicate with debugger backends. Because debuggers typically do not implement this protocol, some intermediary is needed to "adapt" the debugger to the protocol. This intermediary is typically a standalone process that communicates with the debugger.
We call this intermediary the Debug Adapter (or DA for short) and the abstract protocol that is used between the DA and VS Code is the Debug Adapter Protocol (DAP for short). Since the Debug Adapter Protocol is independent from VS Code, it has its own web site where you can find an introduction and overview, the detailed specification, and some lists with known implementations and supporting tools. The history of and motivation behind DAP is explained in this blog post.
If you're interested in learning about the attaching part of things, see https://microsoft.github.io/debug-adapter-protocol/overview#launching-and-attaching, which links to https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Attach, which says:
The attach
request is sent from the client to the debug adapter to attach to a debuggee that is already running.
Since attaching is debugger/runtime specific, the arguments for this request are not part of this specification.
at the end, I would like to see if I can somehow debug Go code that is embedded into a Python package via GoPy.
I assume it's not really trivial to implement these things, and they're usually done on a per-technology basis. You could just run two debugger sessions and attach to the inner program. Or you could take a look at what dedicated extensions are doing if you're interested in trying to write a custom extension for your use-case. Ex. benjamin-simmonds.pythoncpp-debug
.