1. without api
User puts their search query on "https://google.com.au" search box - for example "corgi puppies nsw"
Your example with gum site is that they have provided search pages or search templates, which are later indexed by Google, so all that is already a pre-made search preset. There is no api involved here.
If we would like to implement this in generic cases (no presets), first problem is that Google very rarely provides search keywords, so you cannot achieve this effectively for all users, all search cases, etc. Anyone searching on Google as an ordinary user (e.g. in their browser), with or without specific site, is not going to work in most cases, because there is no data to work with in the first place! Also, google shows only indexed pages, not general search links (they are low quality), keep this in mind, but exceptions for established domains obviously differ from this example. It will either return item page, or category page containing something that matched what user wants, not what you think user would search on your site. Again, unless you make some presets and make them index-able, and Google indexes them in the end.
The user is then directed to my website ... (subcategory)
Another problem (still elaborating on generic non-preset cases): as explained in above paragraph, this will require that Google passes search keywords (which Google doesn't most of the time, for various reasons: user privacy, business factors) and you need logic at your end to figure out this subcategory correctly, too. So, we are back at simple search examples and indexing.
2. with api
It is possible to integrate custom google search ON your site with this method, but users are already there - on your website, not google.com/search.
You will need to code things and integrate them very tightly within your osclass (e.g. plugin) and theme (search results display and interaction), also, you will have to treat it separate from internal Osclass search, you can't* mix and match those easily, because results from Google may be completely different e.g. there is no way to later apply 'internal' custom fields, price filtering, location etc. on search results from google results unless structuring your data if you wish to utilize later google filtering etc. and work on returned json data. It is completely separate from internal search (unless you somehow construct your own search object from google results equivalent to Osclass internal one and later allow mix and match with internal filters, which is a lot of coding). Also, keep in mind G pricing, which is very limited in number of free daily searches (requires payment beyond that).
In summary, this can get very complicated beyond simple search, and this is not what you asked and it will not provide functionality you are seeking at all!