Depends on the printer. Some brands/models are more forgiving of aftermarket or refilled cartridges.
I’ve found HP is the least forgiving, but you can purchase factory remanufactured HP cartridges online for a decent discount.
I’ve had my best luck on sites like Buy.com or Amazon.com.
You will find that some discounters operate several websites with different names, all the same provider.
24/7 Printer Depot (I think that is the name) is one, had decent luck, but they changed their initial provider, not good any more. Just kinda pot luck.
You said it. I love my HP printer to death but have had the worst luck with after market cartridges. I just bite the bullet and buy the HP cartridges.