Yeah, it's hard to think of it until you consider that the tire casing will give it shape, and what's going on inside the tire casing.
Source:
https://motocrossactionmag.com/10-things-you-need-to-know-about-inner-tubes/
Realistically, if I got stranded with my 2.50-17 front tire being flat and all I have is a 3.00-17, the 3.00 is going in and I'm not going to think too hard about that other than "can I patch the previous tube?" And if that went out, I'd resort to bushcraft of stuffing whatever I can in there to keep the rim from getting dinged, but also being able to roll out of there. In Australia, there was a bush series where they even shoved the Aussie equivalent of spinifex in there and ran it without a tube at all.
Using the wrong size tube is not recommended though. There's also a certain amount of folding that can occur inside the tire if you're unlucky and/or trying to use a 18 inner tube in a 17 rim. For bicycles, they generally recommend plus or minus one tire width is about the maximum limit for the same reason, but the installation of most bicycle tires is substantially easier and less pinch prone than motorcycle tires (due to the more flexible sidewalls). So for example, if you had a 700x28-32 tube, and you're trying to put that in a 700x35 or a 700x25 tire, it generally isn't a problem. Having done that before multiple times, I'm better off stuffing a slightly smaller tube into a slightly larger tire as I've had better results with that statistically, but I'd probably keep the speed low until I could get an actual fix going - not a problem on this bike, but been a consideration point on all my other motorcycles.