Can I do cardio during during right inguinal hernia?

Yes. Not exactly sure what the question is, but you can exercise if you have a hernia, but should limit activity based on symptoms.
Before or After? It's unclear from your question if you are asking about activity before or after surgery. Preop: pain would be the limiting factor. Postop: depends on method of repair, but, in general, one can start up aerobic exercises within a few weeks, building up to baseline in 4-6 weeks.