First of all, those custom dialogs are normal HTML overlays. Even if you use a custom dialog, the next step would be to display the default dialog. To ask for notification-permission using javascript, that default dialog is the only way to go. Sadly there is nothing one can do about it.
Hope this clarifies your doubts :)