Painting multiple objects
The first thing to understand is that Texture Paint mode only paints on one mesh at a time.  Even if you select multiple objects, only the active (i.e., normally the last selected) object will be set up for painting.

The second thing to understand is that Texture Paint mode will only render the active object (the one you're painting on) with the texture that you currently have selected for painting, and other objects in the scene will be rendered according to the current Viewport Shading mode (set by Z).  If the Viewport Shading mode is "Solid", then the object being painted will show the texture, but other objects will have the usual boring gray shading.  For example, here I'm painting on the cube on the right, and the cube on the left is rendered using the "Solid" setting:



However, if you switch Viewport Shading to "Material Preview" or "Rendered" AND if the materials for the objects are properly set up to render the texture (e.g., you have a Principled BSDF whose Base Color is set to the texture), then non-active objects will show the texture, too.  Here, because the cube on the left has a proper material set up, it shows the texture, too, as soon as I switch the Viewport Shading to "Material Preview" even though I still only have the cube on the right set up for texture painting.



If you want to be able to paint on both cubes at once, you need to combine them into a single mesh.  You can do that by selecting both cubes and then hitting CtrlJ to join them together.  They'll now be one object/mesh, and you can select the combined object and paint on it in "Texture Paint" mode.  Later, you can separate them again by selecting the combined object, switching to edit mode, and using Mesh -> Separate -> By Loose Parts to break them into separate meshes.