You are probably referring to rim dimensions which won’t matter too much. What is going to matter is tire diameter more than anything. If your winter tire diameter is significantly different than your spare I would suggest that you might want to consider replacing the spare. If it is within an inch of your winter tires I would not worry about it. Keeping in mind that the tread pattern is most likely different as well and you don’t want to necessarily rack up the miles riding on your spare. But it’s just a spare, get the flat fixed asap.
If you have to use your non-winter tire spare with three winter tires for a minute while you fix or replace the fourth winter tire, you’ll be fine. Obviously your snow performance will be compromised.
The total rolling diameter of the tire is what matters here. If you put a tire on your truck that has a non-trivially different diameter than the others, your system will detect the difference in rolling speed and may interpret that as wheel slippage, which could provoke it to respond in ways you don’t want.
The stock 20” set and the stock 18” set are almost exactly the same diameter due to differences in sidewall height on the tires. So no problem.