Google tells us:
Your structured data must be a true representation of the
Put the structured data on the page that it
describes, unless specified otherwise by the documentation.
Thus, you can easily set the markup for the search box and logo on all pages that have a search box and a logo in the main (visible to users) ...