There is a difference. First and second are adjectives, and firstly and secondly are adverbs. But in usage they are sometimes interchanged (and often incorrectly). Firstly and secondly should really only be used for points of an argument or discussion--think "to begin with." You should never put the adverb form (firstly, secondly) at the end of the sentence and never use "firstly" unless there are more points.
When you are denoting order, first, second, etc. is preferable and it can be placed at the end, as in "I did my homework first, then went for a walk."