you should be able to go ahead and upgrade the graphics card.
Where as the recommended power supply for the graphics card is 400 W. So please check the power supply and its form factor.
Disclaimer: HP Doesn't recommend any upgrade/downgrade of any hardware parts or software that is bundled with the product. It may affect the manufacturer's warranty and performance. You can change the configuration at your own risk
Hope this answers your question.
Good luck and keep me posted about the developments. If this helps, please mark this as “Accepted Solution” as it will help several others with the same issue and give the post a Kudos for my efforts to help. Thank you and have a great week ahead. 🙂