Is it safe to take amikacin while pregnant or breastfeeding?

No. Amikacin is a pregnancy category d drug, meaning there is positive evidence of human fetal risk. In lactation, safety is unknown.
Yes. While these kinds of drugs do cross the placenta and can damage fetal kidneys, if they are needed to treat a serious infection in the mother then they are used.