This might depend on country, but in most countries that have some consumer protection, replacing a hard disk and similar reasonable operations are considered to be normal use of the machine, and the consumer law says that the consumer may not be prevented from doing this.
When the customer is not a consumer but a company, then things might be different (companies may be able to give away their rights in a way that consumers may not).
In EU countries, a manufacturer may offer a warranty, but this is just supposed to be an extra service; the seller is at least required to provide defect liability (i.e. a device must fixed if broken when it is sold and it must last for a reasonable time in reasonable use).
I have a T440p laptop which opens up very nicely and cleanly for user hard drive replacement. 2 screws and the whole back cover pops off, no "warranty void" stickers or any of that. I also upgraded the WiFi module to one that supports 5 GHz, and upgraded the RAM to 16GB, all without any fuss from the chassis. It was significantly cheaper to order the barebones system and do these upgrades myself than to order a more advanced system pre-assembled from Lenovo.
So I don't think changing a hard drive would void it. But also, I don't usually care about warranties. Things usually break only after the warranty expires, and for any electronic device, as long as it's a common enough model number it's usually possible to get spare parts on eBay when the time comes.
Kinda offtopic, but this is a bit misleading. The T4x0s series, for instance, makes it very difficult to access anything -- and the T series is known as one of the good ones!
Also, Thinkpads all have a BIOS whitelist that prevents you from actually using the hardware you just easily installed.
Wow, wouldn't have guessed. Haven't played with a T4x0s. I have a T4x0p (T440p) and it's extremely easy to access everything. But I just looked at some Youtube videos and the 's' is indeed a world of difference from the 'p'.
I've yet to encounter a manufacturer that considered a hard drive swap to be warranty-voiding. Capacity upgrades are generally perceived to be routine enough to be considered normal use; making it warranty-voiding would be like making the installation/removal of USB devices warranty-voiding.
For example, If your HDD fails under warranty, they'll ship you a new one with the simple instructions to replace it. Only tool needed is a small Philips screwdriver. :-)
When the customer is not a consumer but a company, then things might be different (companies may be able to give away their rights in a way that consumers may not).
In EU countries, a manufacturer may offer a warranty, but this is just supposed to be an extra service; the seller is at least required to provide defect liability (i.e. a device must fixed if broken when it is sold and it must last for a reasonable time in reasonable use).