I'm trying to connect my laptop (Dell XPS 17 L702X) to a TV via HDMI. In the process I've hot-plugged the cable several times, but to no avail. Could this damage the HDMI port on my laptop or TV?
According to the HDMI specification, yes it's hot-pluggable.
It supports "HPD" (Hot Plug Detect Signal).
The HPD (Hot-Plug-Detect) feature is a communication mechanism between a source and a sink device that makes the source device aware that it has been connected/disconnected to/from the sink device. When an HDMI cable is inserted between the two devices, the resulting hot-plug detection instantiates a start-up communication sequence.
As noted in the other answers, it's hot-plug, as per the specification (most recently freely available version is 1.3a, references are to that version here).
Damage may be physical, or electrical.
Physically, type A connectors should be good for over 10,000 insertions (as good as micro-USB), see §4.1.6 Connector Mechanical Performance.
Since it's possible to get imperfect (simultaneous) mating of all pins, one side may not initialise correctly during hot-plugging, that ought not cause damage. HDMI is robust against shorting any combination of pins or connection (§4.2.11 Robustness Requirements). §8.5 Hot Plug Detect Signal describes the connection and HPD process.
There is a dedicated pin for hot-plug, the HPD pin, damage to this will cause problems (but you can say that about any pin). After HPD is asserted, an E-EDID data exchange should occur.
Warnings that come with HDMI devices or cables instructing you to power-off before connecting may be intended to minimise electrical discharges and other effects due to potential differences between grounds (the cause of "ground loops").
In my experience, aside from old or bad wiring, the main sources of ground loops are cables originating from different providers: cable, phone and electricity. Ethernet with metalized 8P8C (RJ45) connectors could also cause problems (more about ethernet and grounding). Low quality SMPS (switched-mode power supplies) in cheap electrical equipment are another problem (earth leakage, dubious isolation, undesirable modes of failure).
It may be prudent to interconnect devices with different input sources while the devices are powered off, but still plugged in so that they are grounded.
So to answer your question: if your TV has a direct connection to an analogue coax cable provider, there might be a ground loop which could in principle cause damage to circuitry when making connections. If your laptop is not plugged in to a charger (or ethernet) this is less likely to occur.
One additional consideration might arise due to HDCP (content protection) – when you have more than two HDMI-capable devices the order in which you plug things in may cause different end results. Whether that conflicts with your understanding of hot-pluggable is up to you ;-)
HDMI, like most modern cable interfaces, was designed to support hotplugging. The HDMI connector uses pin 19 as "Hot plug detect".