No. You cannot castle if the king passes through a square that is attacked by an enemy piece. You also cannot castle while in check, or if the king would land on an attacked square. The rook, however, is allowed to pass through an attacked square when castling queenside.