How to generate the exact AES key in both client and server side? I am using AES to create a secure tunnel for transmission of data.
As the symmetric key encryption will require the same key to encrypt and decrypt, so we need to generate the exact same key for the decrypt process. Is there any possible way for me to generate the exact same key for both side?
There are two main ways to have the same symmetric key on both parties:

key exchange using asymmetric crypto
generate the key from a known secret (eg: a password), such as using a password-based key-derivation function

The former is what you will find in TLS, where public key infrastructure is used to verify the other party's public key.
The latter is used in things like command-line encryption tools to derive a symmetric key from a password (and salt).
If you wish to setup a secure communications channel, your first choice should be TLS unless you have a very good reason not to use it.