This is a really interesting use case. Because the Figma components are not directly tied to the code, you’d need strict naming convention adherence if you wanted to build a tool that would support that.
Not necessarily. Figma outputs the appropriate CSS - I think you could probably pattern-match one to the other with a relatively simple model by looking at sizes, colors, shadow settings, defined states, and perhaps even by rendering it out and doing image matching.