Sort of. You can't double dip (get paid twice for the same service). Any federal government job will add your years as a marine to your total time in service as long as you're not retired. You have to buy in the time for the FERS system so it can cost a little (it can be paid in small increments out of your check). The longer you wait to buy in, the more it costs. I paid $2500 for my 8 years of service that occurred 13 years prior to my federal employment. They took it out of my paycheck in $25 increments until it was paid in full.
You can do it if you're retired military but you can't collect both for the time you were in the military. That is, you won't get a military retirement and a federal retirement check covering the same period of service. So say you did 25 years (20 military and 5 federal). You won't get your 50% pay and 30 years of federal service credit. You can get your military and 5 federal years.
You can get your 50% military time and a federal retirement but your retirement pay for federal service would start on the day you start your federal job (minimum 5 years) 1% for every year you work for your highest 3 year average. So say you made $50K in your federal job as your 3 year average. So if you worked 5 years, you'd get 5% of your highest 3 year average ($2,500 per year) in addition to your military pay.
You can give up your military pay and apply it to federal service pay but you don't collect it until age 62. Most retirees where I work collect the military pay instead of converting it to FERS.
Federal employee with 8 years military service