If you buy a bike “off the peg” from a store if they are anything worth their salt, they will try to fit you to a bike which “generally” fits your body shape best. “Off the peg bikes” are made by all manufacturers to fit the average body shape. The problem here is that we are all different shapes and sizes; long torso or short torso, long or short arms/legs than average body shape.
Even so, this can be catered for in most cases with an off the peg bike. You can raise or lower the height of the saddle and/or handlebars move the seat forward or backwards, change the handlebar stem to move the handlebars closer or further away, even change the length of the pedal arm on the chainset. All of these can lead to a more comfortable fit of an “off the peg” bike. But in some cases you may need to pay to replace a part, such as the handlebar stem or the crankset pedal arms, these are not specified as options on most “off the peg” bikes.