Border crossings can be good for hitchhiking. Cars have to stop and if you successfully make it to the next country you can easily hitch a ride going far towards your destination. Generally people are much more likely to pick you up after you crossed the border yourself.
In some places, such as some crossings in Turkey and New York State, they don't like people walking across the border. It's mostly better to get a ride across the border and get out there if humanly possible (if there are e.g. money exchange offices).
At all times keep your bag with you when leaving your car. You might be sent back to the country you came for, or other bad scenarios could happen.