You can withdraw funds from your trading account if you have open trades. The main condition for withdrawal is that the funds must be available — they should not be currently tied up in trades.
Please note that in the MetaTrader system, the amount of free margin available in your account can significantly affect the likelihood of forced liquidation of your trades. This is because the account balance supports all open trades simultaneously.
Therefore, the more free margin available in your MetaTrader account, the greater the drawdown the account can withstand in case of a sudden price movement.