Short answer, yes you can get your wood more straight than you will find at the box stores, and even from your hardwood dealer.
It would stand to reason, as you say that they should be able to produce a straighter product, but the reality is they are dealing in volume, and so there are many factors. First, they are going to be using the cheapest quality material that they can reasonably get away with, as they have to turn a profit.
Second, this material is milled in volume, and usually is not given much attention to each individual piece. They will often just straight line rip the material on a saw to a rough dimension, and then send it through a moulder, with 4 cutter heads so it is 'straightening' all four faces in one pass. This gets it close, but ultimately not actually straight.
In addition they are kiln drying everything, and then it most likely sits outside unprotected from the weather for an extended period of time. The moisture content will change rapidly with the environment that it is left in, and while sitting in large stacks, the wood will expand and contract, and ultimately be left fairly warped.
If you take a piece of hardwood home, and straighten it properly on a jointer on two perpendicular edges, and then plane it to thickness, removing material as evenly as possible from the opposing faces (taking all of the material off of one face will cause even more warping/bowing), then you can get a very straight board. Furthermore keeping the wood in a more steady environment (out of the rain, limited humidity, closer to its final destination) it will maintain a more constant form.
Now beyond this, it must still be noted that wood will always move, and in any project built with wood, this movement must be understood and accounted for in the design. If you account for this properly, and accept it early on, you will be successful and happy with the final result.