If i can generate a wallet and corresponding private key offline, and those can fit in the blockchain when I go online
Correct.
does it mean that there is a certain formula between a wallet and the private key?
A wallet can hold one or more addresses and private keys. There's no formula there.
A private key is generated
at random, and the address is derived from the private key.
Can people use that formula to get my private key simply knowing my wallet address?
No. If you generate the private key in a proper way, nobody can steal your funds.