A conversion of AA-to AB-stacking bilayer graphene (BLG) due to interlayer interaction is demonstrated. Two types of interlayer interactions, an attractive and a repulsive, between the Boron and Nitrogen dopant atoms in BLG are found. In the presence of the attractive interaction, an AA-stacking of BN-codoped BLG is formed with a less stable structure leading to weak mechanical properties of the system. Low values of the Young modulus, the ultimate strength and stress, and the fracture strength are observed comparing to a pure BLG. In addition, the attractive interaction induces a small bandgap that deteriorates the thermal and optical properties of the system. In contrast, in the presence of a repulsive interaction between the B and N atoms, the AA-stacking is converted to a AB-stacking with a more stable structure. Improved mechanical properties such as higher Young modulus, the ultimate strength and stress, fracture strength are obtained comparing to the AA-stacked BN-codoped BLG. Furthermore, a larger bandgap of the AB-stacked bilayer enhances the thermal and the optical characteristics of the system.