You can use google search bar on your website as long as the template you are using for your website has that option. If there is not this option, you can use it through widget or plugin. There is no issue with google.Before using google search tools added to your website. I believe you need to be approved by google before using there feature in your website interface. Because any attempt to use google tools without approval is tagged as illegal and they have the right to issue your website for imminent ban.