I submitted a case with Esri about using FTP with AGOL Notebooks, and got this back today --
------------------------------------------------------------------------------------------------------------
Case #03441759
The behavior you've described, where FTP connections appear to be blocked when running a script in ArcGIS Online Notebooks, is likely a result of the security and network access restrictions enforced within the ArcGIS Online environment. ArcGIS Online is hosted in a secure cloud-based platform, and these measures are in place to ensure the security of the platform and its users.
If you're encountering a "ConnectionRefusedError: [Errno 111] Connection refused" error, this is indicative of the FTP connection not being allowed. To work around this limitation, I recommend using an alternative approach: consider utilizing another server where the ArcGIS API for Python can be employed to upload data to ArcGIS Online. Unfortunately, AGOL Notebooks cannot use FTP to download data due to these security restrictions.
------------------------------------------------------------------------------------------------------------
So yeah -- FTP connections are blocked with AGOL and AGOL Notebooks.