Since resnet18 uses an adaptive pooling layer before the flatten operation, the input shapes are flexible.
However, this might of course degrade your performance and the architecture might not make sense, if your inputs are too small.
Your use case reminds me a bit of CoordConv 2 by Uber, which provided a coordinate system to their inputs. Would something like this make sense for your use case?