HP power adapters are pretty much all the same voltage.
The wattage and connector are what matter. Newer machines typically use a 4.5mm barrel connector, while older systems may use a 7.4mm or (even older) 4.8mm barrel connector.
If they're both HP and they use the same connector? It definitely won't break it. HP power adapters and laptops are smart enough to handle this situation safely.
If it's underpowered, it'll probably just charge more slowly or discharge under load. The laptop isn't going to try to exceed the adapter's power rating.
If it's the other way around, then there shouldn't be a problem at all and you may even get faster charging.
My 2018 HP ENVY x360 13 shipped with a 45W adapter, which believe it or not is underpowered for the system. I later got a 65W adapter and it charges faster especially under load.
If they're the same connector, there's no reason to not expect it to work. Heck, you can use a new adapter with the 4.5mm connector on a system with the older 7.4mm connector via a dongle.
@dustytrash That's probably the legacy 7.4mm connector. Some new HP power adapters with the 4.5mm connector sold at retail include a dongle to allow use with a system that takes 7.4mm adapters.
@dustytrash Then that will work. It's definitely not going to damage anything.
Just to double-check, can you post an image of the connector?
It'll work, but bear in mind that if you want to use a new power adapter on it, the 7.4mm barrel connector is a legacy connector so you're going to need a dongle.
That said, the 7.4mm connector is still used for certain HP systems with very high power requirements (e.g. OMEN gaming laptops requiring more than 200W).