When my aunt was married in 1985 she hired a Justice of the Peace to be their officiant. The wedding was in Suffolk County, Long Island. After the officiant arrived for the ceremony he notified the couple that he wasn't licensed to marry them in Suffolk County, only Nassau County.
After their ceremony at the catering hall my aunt, new uncle and two witnesses got in a car and drove to the county line on the Long Island Expressway. They pulled over to the side of the road and in the car the Justice of the Peace redid the ceremony - making their marriage legal.
It's very important to confirm that your officiant can legally marry you. If you're not sure what the laws are in the state, or country if it's a destination wedding, you are getting married in then contact the local government office. Each state, and I'm assuming many countries, will have marriage license laws listed on their official website so it shouldn't be difficult to find.
Also, if you are having a friend or relative marry you confirm that they have been ordained through a ministry - online or off - that the state (or country) recognize.