@Graham *****
you need to apply online for the Non-Immigrant O visa from your home country. The Thai Embassy in your home country will then , after approval, send you the E-visa after which you can travel to Thailand and start the process to get your marriage visa.
You absolutely cannot get the Non-Immigrant O visa from Khon Kaen immigration after arrival !!!