At first thought, the absolute maximum apparent diamater of a companion world in the sky of a habitable world would have to be 180 degrees since if any portion of it appeared to extend more than 90 degrees from the Zenith it would extend below the horizon and be hidden by the horizon.
By this same train of logic, since the full Moon must always be 180 degrees from the sun, you can never see the full Moon and the Sun both totally above the horizon. You can see the full Moon totally above the horizon while the Sun is totally below the horizon by the same number of degres. You can see the Sun totally above the horizon while the full Moon is totally below the horizon, hidden from sight, by the same number of degrees. Or you can see the Sun and the full Moon both at the horizon, part visible above it and part hidden below it at the same time.
But you could never seen both the full Moon and the Sun totally above the horizon at the same time.
Or so I though until the time when I saw both the full Moon and the Sun visible at the same time, both several degrees above the horizon.
And I eventually realized that there were three factors which made it possible to do so. And I felt stupid for not realizing those factors before I actually saw them both in the sky at the same time.
But that doesn't matter. even if you stood on the surface of a habitable world, and another world, an asteroid, comet, moon, planet, brown dwarf, or star was just an inch above your head, that world appear to cover a bit less than 180 degress of the sky. In any possible situation the other world would be much farther away that and cover much less than 180 degrees of the sky.
There was a discussion in another question about this problem.
What is the largest possible appearance of a celestial body in the sky?
Using the example a planetary sized habitable exomoon orbiting a gas giant exoplanet, I claimed that the exomoon would have to orbit outside the "habitable edge" of the gas giant planet.
The "habitable Edge" is a distance between the planet and its moon where the tidal interactions between the planet and moon produced excessibe tidal heating. If the total heat reaching the surface of an otherwise habitable exceeds a certain level, evaporation of water from the surface will increased drastically. Water vapor is a strong greenhouse gas, and the incrased water vapor will heat the atmosphere more, the surface will get hotter, and more water will evaporate, causing more and more water to evaporate until all the surface water become water vapor in the atmosphere as a result of the Runaway Greenhouse effect (RG). And without surface water, the world will be uninhabitable.
A lot of tidal heating mixed with radiation from the star can make an otherwise frozen world warm enough for liguid water and life, or even cause a RG.
Even more tidal heating can cause high levels of volcanism, making the surface of a world a volcanic hell like the surface of Io, the innermost large moon of Jupiter.
So in "Exomoon Habitability Constrained by Illumination and Tidal Heating" Astrobiology, January 24, 2013, Rene Heller and Rory Barnes introduced the concept of the Habitable Edge, a distance from a planet that all its moons would have to orbit beyond to avoid too much tital heating.
https://arxiv.org/ftp/arxiv/papers/1209/1209.5323.pdf
In "Magnetic Shielding beyond the Planetary Habitable Edge" Rene Heller and Jorge Zuluaga 2018.
https://arxiv.org/pdf/1309.0811.pdf
The formation of a gas giant exoplanet's magnetic field is discussed. If a potentially habitable exomoon doesn't have its own magnetic field to protect it from steller and cosmic radiation, it might be protected by the planet's own magnetic field if it orbits within that magnetic field. And on the other hand, if the moon happens to orbit within the radiation belts were the planet traps charged particles it will get an even greater dose of radiation.
In the body of the article Heller and Zuluaga calculate the formation of a planet's magnetic field and to find out whether it can extend out far enough to envelope a moon beyond the Habitable Edge before the moon suffers too much damage from stellar and cosmic radiation.
And in the abstract they say:
We here synthesize models for the
17 evolution of the magnetic environment of giant planets with thresholds from the runaway greenhouse
18 (RG) effect to assess the habitability of exomoons. For modest eccentricities, we find that satellites
19 around Neptune-sized planets in the center of the HZ around K dwarf stars will either be in an RG
20 state and not be habitable, or they will be in wide orbits where they will not be affected by the
21 planetary magnetosphere. Saturn-like planets have stronger fields, and Jupiter-like planets could coat
22 close-in habitable moons soon after formation. Moons at distances between about 5 and 20 planetary
23 radii from a giant planet can be habitable from an illumination and tidal heating point of view, but
24 still the planetary magnetosphere would critically influence their habitability
So if an otherwise suitable exomoon doesn't have a strong magnetic field of its own, it should have to orbit within about 20 planetary radii in order to be shielded by the planet's magnetic field. If the exomoon has a strong magnetic field of its own, it could orbit beyond 20 planetary radii.
And the important fact is that the Habitable Edge is said to be at five planetary radii so a habitable moon would have to orbit at a distance of at least five planetary radii or two and a half planetary diameters.
So if a moon orbits its planet at five planetary radii, a circle with its center in the center of the moon, and with a radius extending to the planet will have a radius of five planetary radii, and thus acircumference of about31.4159 planeteary radii or 15.70795 planetary diameters. And thus the planet should appear to be about 22.918331 degrees wide in the sky of the exomoon at the Habitable Edge, or about 45.8 times as wide as the Moon appears from Earth.
And I claimed that was about as about as wide as any celestial body could ever appear in the sky of a habitable world which had been habitable for billions of years and would continue to be habitable and not be devastated by the proximity of the larger world.
Maybe the question will be statisfied if the two worlds get close enough to destroy all life, but the planets are not destroyed, but I tend to interpret it as asking how close the planets can get get without minor effects like tidalheating wiping out all life.
And Starfish Prime claimed that the Habitable Edge only matters if the planet has other large moons to make the habitable moon's orbit more elliptical and increase tidaly heating. They claimed that without other large moons making the moon in question's orbit more elliptical, the orbit would quickly be circularized, greatly decreasing the tidal heating and making the concept of a habitable edge meaningless.
they also claimed that since a solid exomoon would be more dense than a gas giant exomoon, the exomoon would never find itself within the Roche limit of the exoplanet and be indanger of breaking up. Instead the gas giant exoplanet might be within the Roche limit of the exomoon and be in danger of having a lot of its atmosphere pulled away by the exomoon.
Starfish Prime claimed the maximum possible angular diameter of another world seen from a habitable world would 131 degrees.
The answer by The answer by L. IJspeert gives figures of 104 degrees, 65 degrees, or 19 degrees.
Then there is the case of Phobos, the innermost moon of Mars. Mars has an equatorial radius of about 3,396.2 kilometers, and the orbit of Phobos has a semi-major axis of 9,376 kilometers, or 2.76 planetary radii.
So why doesn't Phobos suffer from a runaway greenhouse? Phobos is far too small to have much tidal heating. And even more importanly, Phobos is far too small to ever have an atmosphere or ever be habitable even without a runaway greenhouse. So phobos could never be a habitable world to view Mars from.
According to my rough calculations, Mars should appear about 41.34 degrees wide as seen from Phobos, about 82.68 times the width of the Moon as seen from Earth.
The dwarf planet Pluto has a radius of about 1,188.3 kilometers, and its largest moon, Charon orbits with a semi-majar axis of 19,591.4 Kilometers, or 16.487 times the radius of Pluto. Pluto is only about 6.95 degrees wide as seen from Charon, only about 13.9 times the apparent with of the Moon seen from Earth. So scaling up the Pluto-Charon system to make one or both objects was the size of a habitable would would not make either world super large as seen from the other.
I have thought of a double planet, with one or both planets the size of habitable worlds. But with their strong gravitational and tidal forces on each other, the worlds would slow down their rotations and push each other farther away. Only when they stopped slowing each other's rotation rates, when both worlds were tidally locked on each other, would they stop pushing each other away. And by them they should have pushed themselves many times farther away then when they formed.
And it takes billions of years for a planet to form a breatheable oxygen rich atmopshere. The twin planets would not be habitable for humans or other oxygen breathing lifeforms when they were young and close together.
See my answer to this question:
How can the stars be wrong, so that an observer realises they're not in our world anymore?
I discuss several possibilities including seeing a galaxy from outside it but rather close. The problem is that the innermost region of a galaxy is likely to appear very bright at a distance, while the farther from the center the dimmer the galaxy will will look, until the outermost regions might appear as black sky with more distant galaxies seen through it and maybe appearing a very dark grey color a little lighter than pure black. Thus it is hard to calculate how wide a galaxy with a known actual diameter would appear at a specific distance.
And there is the possibility of a star appearing very wide in the sky of a habitable planet. I think I discussed that somewhere.
The less massive a star is, the cooler it will be, and the cooler a star is, the less light it emits from a square meter of its surface. Also the less massive a star is, the smaller its diameter will be, and so the smaller its light emitting surface will be. So the less massive a star is, the closer a planet will have to be to it to receive the same amount of radiation as Earth gets from the Sun, and thus to have the same surface temperature. Thus if aplent orbiting a cooler star gets as much radiation as Earth gets from the Sun, it will be so much closer that the star will appear larger than the Sun appears from Earth.
I call the distance from a star where a planet would receive the same amount of radiation from that star as Earth gets from the Sun the Earth Equivalent Distance or EED. The Sun is a G2V class star, and its EED is Earth's actual distance from the Sun, one Astronomical Unit or AU.
The brightest K class main squence stars are K0V stars, with about 0.813 the diameter of the Sun and 0.46 times the luminosity. With 0.46 times the luminosity of the Sun,the EED would be at a distance of the square root of 0.46 times 1 AU, or 0.678 AU. The Sun at a distance of 0.678 AU would appear 1.4749 times as wide, but a K0V star would have 0.813 the diameter of the Sun and so appear 1.199 as wide as the Sun appears from Earth.
A M0V star, the brightest class M main sequence star, would have a diameter 0.588 that of the Sun and luminosity 0.069 that of the Sun. Thus its EED would be at 0.2626 AU and it would appear 2.239 times as wide as the Sun appears from Earth.
A M9V star, the dimmest class M main sequence star, would have a diameter 0.102 that of the Sun & luminosity about 0.0003 that of the Sun. Thus its EED would be at 0.0173 AU and it would appear about 5.895 times as wide as the Sun appears from Earth.
So at the moment a gas giant planet seen from a habitable moon seems like the best candidate for the widest possible object seen from a habitable would which is not being devasted by the closeness of the object in the sky.
Unless the asker will be satisfied if all life is destroyed on the worlds when they pass close, but they don't destroy each other, or if the worlds never had any life to begin with.
Either possibility will enable a world to get much larger in the sky of another world.