I'm trying to build a ResNet 18 model for Cifar 10 dataset, but I'm not able to fit the data dimension
The problem is that your ResNet-18 follows the architecture for ImageNet as outlined in the ResNet paper:

However, spatial input dimensions of ImageNet are different from CIFAR10 (32x32) so the architecture does not match your input. Instead you can follow the author's description of their CIFAR10 architecture in section 4.2 of the same paper:

The plain/residual architectures follow the form in Fig. 3
(middle/right). The network inputs are 32x32 images, with
the per-pixel mean subtracted. The first layer is 3x3 convolutions.
Then we use a stack of 6n layers with 3x3 convolutions
on the feature maps of sizes 32; 16; 8 respectively,
with 2n layers for each feature map size. The numbers of
filters are 16; 32; 64 respectively. The subsampling is performed
by convolutions with a stride of 2. The network ends
with a global average pooling, a 10-way fully-connected
layer, and softmax.