Can PIs compete for good postdoc/PhDs by offering better salary than others?
This will depend wildly on the setting in question. For example, NIH grants have specific postdoc rates, and while a professor could "tweak" those offers (usually in ways that involve a second grant/account/etc.) they may or may not have the ability to do that.

Additionally, there may be departmental requirements - for example, in my current department, all graduate students are paid a fixed rate, take their preliminary exams and get a slight bump to another fixed rate. There is no flexibility in this, by design.

As for whether or not it's a good of bad idea? I think it's a bad idea for my lab. Salary negotiations create an unlevel playing field among the members of my lab, and that's not a message I'm willing to send by "sweetening the pot" for one postdoc vs. another. The only differential benefits I'll accept is if the "unit price" of something is variable - for example, if I offer to pay for a postdoc's plane ticket when they move to join my lab, I pay for a plane ticket, understanding that someone coming from a state away is likely to be less expensive than someone coming from overseas.