That would depend on what you want to block.
Generally speaking, it won't work for well over 80% of websites world-wide (and that number is ever nearing the 100% mark, and may well be over 90% for websites in your respective country).
HTTPS connections provide authenticity of the server you are connecting to by crpytographic means, so you can be sure you are communicating to the server you intend to contact.
You'd have to break that encryption if you wanted to show an arbitrary page instead of actual web server content (which would include forging certificates for every site you want to block).
The continuing proliferation of HTTPS was one of the major reasons why Pi-hole has switched to NULL blocking (unspecified IP blocking) as default years ago.
Pi-hole is a filtering DNS forwarder - blocking occurs by domain exclusively.