It is certainly possible to use a conv layer in order to transform the grayscale input images to images containing 3 channels. To keep the spatial dimension you could use e.g. a 1x1 kernel or any other setup with the appropriate padding (since you’ve mentioned a padding value of 1 I assume you would like to use a 3x3 kernel with stride=1 and dilation=1).
“Side effects” would be that you are adding more trainable parameters at the beginning of the model. Assuming you would like to train this layer, Autograd would need to backpropagate through the entire model, which could be avoided in case you would freeze the pretrained model and only train the classifier.