First hook to use current page post id

Answer by @Pieter Goosen :

If you need to update the page before the main query fires and returns
the page object, you will manually need to parse the URL (probably on
init) and get the page ID from get_page_by_title() or
get_page_by_path().

Otherwise, ‘wp’ would be earliest hook to get the page ID, for example:

function my_early_id() {
    $post = get_post();
    echo $post->ID;
}
add_action( 'wp', 'my_early_id' );