NanoStudio 2 is able to host and use AUv3 MIDI plugins, but it isn't able to record their output to the piano roll as of this writing Nov. 5, 2021. Workarounds for this involve routing the MIDI out of NS2 and then back in on another track. The most commonly mentioned method is to use a the MIDI Route plugin from the MIDI Tools Suite. Unfortunately this suite is only available for iPhone. The Audiobus 3 and AUM methods will work for both.
There will be some latency caused by the round-trip. The settings for the MIDI Out track include latency compensation that may help to correct this.
[Update: July 2022] The AUv3 MIDI Recording Workarounds page has additional details and a video in the subheading for Nanostudio 2.
(iPadOS compatible only)