so long as it’s under warranty. yea. make sure you have a way to actually do the ‘factory reset’.
if you nix the partitions during a ‘clean install’ of windows or of linux, you won’t.
unless you’ve made a backup image of the hdd to an external (using reflect or similar), or in hp’s case–download their recovery media creator (runs on windows only but doesn’t have to be the target system) and build a recovery flash drive for your model.