Sure, you can get off in another country and fly back if you let the cruise company know what you are planning to do and book a flight. Of course if your flight, food, and/or lodging after you disembark is your responsibility.
I once heard about a man who was from Puerto Rico but now living in the states who never flies. Whenever he goes to visit family in PR he books 2 cruises. He gets off at PR on the 1st cruise, stays for awhile then gets on the 2nd cruise to return to the states. I have no idea if this is true (heard about him on a message board) but I suppose it's possble. It would be kind of expensive but money may not be an issue for him