Good to hear that you want to learn
I would like to answer to your questions number-wise:
1) Yes you can replace it with any microcontroller capable of handling input-output operations. You should go for AVRs or PICs. Arduino would be a great platform too.
2) Yes you will need to change the pins according to the pinout of the microcontroller you are using. Although there will be some changes in the code as well but the broader aspect of algorithms and steps involved will remain almost same.
3) For AtMegas you can try out AVR studio.
Hope this helps
Good luck and keep learning