Many biological processes, from cellular metabolism to population dynamics, are characterized by allometric scaling (power-law) relationships between size and rate. An outstanding question is whether typical allometric scaling relationships--the power-law dependence of a biological rate on body mass--can be understood by considering the general features of branching networks serving a particular volume. Distributed networks in nature stem from the need for effective connectivity, and occur both in biological systems such as cardiovascular and respiratory networks and plant vascular and root systems, and in inanimate systems such as the drainage network of river basins. Here we derive a general relationship between size and flow rates in arbitrary networks with local connectivity. Our theory accounts in a general way for the quarter-power allometric scaling of living organisms, recently derived under specific assumptions for particular network geometries. It also predicts scaling relations applicable to all efficient transportation networks, which we verify from observational data on the river drainage basins. Allometric scaling is therefore shown to originate from the general features of networks irrespective of dynamical or geometric assumptions.