There are thread sizes which are almost a good fit, but my advice is to avoid them. Any thread relies on several turns in good contact to give strength to the fastening. Anything which is 'nearly the same' will, in effect, only match the thread for perhaps a turn, if that. All the load goes on that turn, and of course, when loaded it yields. This puts all the load on the next turn, and guess what, that yields too. And sometimes it is the bolt that fails, sometimes the nut. Now try to undo it, and what happens? Both parts are jammed, you break the bolt and seize the rest of it in the hole.
Thus your 'emergency' fix turns into a disaster. You cannot complete the job, and the cost and wait for new parts is a real emergency …
Of course, as you will realise, there are close matches in size (such as 5/16" = 8mm), but they should only be used when you are renewing both parts – a M8 nut and bolt will do instead of a 5/16 UNF nut and bolt or a 5/16 BSF nut and bolt, but only if you change both bits together.
And finally, if you choose to ignore this advice, please let me have your address details so I will know not to buy anything you may have worked on (!)
Best wishes
Tim