It's not possible. Not in PS, not in AI, not in ID. For something like that you'd have to define a parametric/ programmatic relation of sorts, meaning you need code or a filter that is dynamically evaluated at runtime, which translates to using Flash/ Animate CC. Of course it would be possible to use conventional scripting to match the text and background elements or you may use otehr techniques like symbols and pattern brushes in AI.
You could do this by first creating different Artboards in Illustrator one for each letter, and export these to SVG files. Then use something like IcoMoon (Icon Font & SVG Icon Sets ❍ IcoMoon ) to import the SVG files and create an SVG font, that you can use in Photoshop.
Make a font. You would probably be able to modify an existing font to add the frame, so it wouldn't need to be a big job. Not that I have ever created a font, but with the countless fonts that there are, it probably isn't too hard a job. I appreciate that we don't know what platform you are using.
I like the look of this one, and it is open source