Yes, you can undock the phone from the device when listening to the music. Even the phone is undocked, the music would not be interrupted. However, the phone would not be charged.
To enjoy your music seamlessly, it is good to keep the Android phone docked on the device.