First of all you are safe to get pregnant. Before that consult a gynecologist to evaluate the possible causes for your miscarriage
. Elaborate investigations may be needed to find out the cause for the m/c. If there is no problem, getting pregnant is OK. But through out pregnancy
you have follow the dr's instructions.