All major airports will have some way of doing this, but the ease and implications depends greatly on country and airport (from trivial to hours of bureaucracy and visa issues).
Mind saying where you are thinking of doing this so some specific advice can be given?