You can not get a Visa or an Extension of Stay at a border.
What you can do at the border is leave Thailand, stamp in/out neighbor country, come back into Thailand using the 30 day Visa Exempt Entry depending on the country of origin of your passport.
You can check yourself if your country is listed in the purple section under Visa Exempt Entry scheme
*************************************************************
%20on%20Arrival/VOA.pdf