Yes Im sure you can unjailbreak an iPhone 3g, you just need to connect it to your computer and remove the software (I think), Also you can check on youtube which has video's which will explain & show how to unjailbreak your iPhone. (I seen them Before)
Hope I Helped! =)