Postgresql Create ForeignKey with repeated table name in value of ref contrain key
Can I create an FK with this type of structure?

No, you can't create a FK because the value of a FK column must match the value of the referenced PK column. But there is no value foo.1  in the table foo.
That design is horrible. I understand you didn't create that mess, but if you do have the chance to fix it, then do it as soon as possible.