The code have to be compiled for your specific target AVR (atmega). If you compile it for Arduino Uno that has an atmega328p on it and your target AVR is different the hex file will not work.
Yeah, i sort of thought of it which made me try changing the board in there. The ISP i have has an ATMega8 but it is used to program the main board which has an ATMega16 on it, so i suppose by target avr it would be ATMega16 then, Right? But then again i guess i don't find any board for the same in the list there.
And for the pin, if those are the pins of the arduino board how would i specify the one's of the target avr?
P.S. Please ignore the stupidity, i am really new into all this arduino thing.