Does it matter where you buy the bike?
It matters in many ways where you buy the bike from. If you're buying online, then the parts will most likely be the same, although you should be careful to read the specs.  Some online (brick and mortar as well) shops will have overstock bikes from previous years and the parts will be different from the current model year.

If you buy from a local bike store, then it starts to make more of a difference where you shop. Many shops will offer free tune-ups for a year or two, and some others will offer free tune-ups for life.  What's included in a "tune-up" can vary from store to store.  Some shops will include a free fitting of the bike to make sure it's properly set up.  

Every actual bike shop, and dedicated sporting goods store that I have been to has, at the minimum, given the bike a the bike a safety check before they actually hand it over to you. I even got this once for a coaster bike (the kind with no pedals/drivetrain) when I bought one for my 3 year old.  

This is to ensure that the bike is in safe operating condition and to ensure that things are working well.  Problems can arise between the initial assembly and when you purchase the bike and they want to ensure that you will be safe and have a good experience.  Stuff like this often isn't done at places like Walmart or Amazon. Often they will assemble the bike and not even give it a test ride to ensure things are actually working properly.