Contracts can be created in the Genesis block, so that they are present when the chain starts.
This is how Quorum implements QuorumChain consensus. The voting contract is embedded in the genesis.json file along with its initial parameters.
You can see an example here - it creates a contract at address 0x20 with the code shown and the initial storage set up:
{
"alloc": {
"0x0000000000000000000000000000000000000020": {
"code": "606060405236156100c45760e0...<truncated>...",
"storage": {
"0x0000000000000000000000000000000000000000000000000000000000000001": "0x02",
"0x0000000000000000000000000000000000000000000000000000000000000002": "0x04",
"0x29ecdbdf95c7f6ceec92d6150c697aa14abeb0f8595dd58d808842ea237d8494": "0x01",
"0x6aa118c6537572d8b515a9f9154be55a3377a8de7991cd23bf6e5ceb368688e3": "0x01",
...
}
},
...
This is the only mechanism I am aware of to do what you are asking about. Contracts can create other contracts, but that just pushes the problem back a step