I just moved into a really old apartment that does not have ground wires at all and I’m getting some really annoying noises when recording my guitar and bass. Could these two things be related? If so, would wiring the house be the only solution?
Those things could be related. Guitar inputs are high-impedance lowish level unbalanced inputs that can pick up a lot of noise (touching a plug tip will give you enormous hum, as will plugging in the guitar with the amp not turned off). It's one reason that guitar amps are traditionally grounded, the other being safety of the player (assuming he does not get to touch a microphone under high voltage while touching his properly grounded guitar strings).
Anecdote: persistent inconsistent hum and other amp noise made me check voltage between ground and return lines in the sockets and then made me check the house's grounding clamp (it's usually connected to water pipes entering the house) which was broken and just hanging loosely on its pipe. Ugh. Musician saves the day, notifying landlord.
When there is no ground (not even a misappropriated return, something which was done in earlier days to keep mains power off metal parts by triggering the main fuse but which makes it impossible to use more modern GFCI devices) to be actually had, the typical traditional amp will float somewhere in the middle, making brushing your guitar strings likely to tingle (but not providing enough current to cause shock on more thorough contact, assuming you are lucky and your amp is in full working order) and cause various noises, particularly when touching other equipment.
Options apart from getting an actual ground line (note that this is building safety related so it has to be done by a licensed electrician according to code) are to separate amp and guitar electrically with a suitable DI, or to separate amp and house with a suitable isolation transformer. The second option tends to be way more expensive and heavy and may retain enough of a capacitive coupling that you get back to the "floating in between" scenario mentioned above.