So the ads on TV are telling us how good Ok Google is - and it is pretty good. What they don't tell you is it doesn't work if your language is set to English(UK). The work around is straight forward though, change language to English(US) - Settings/Language & input/Voice Search/Languages. Then "Ok Google" Detection and check the boxes (1 & 2 or 1,2 & 3). You have to then let your device recognise your voice by saying "Ok Google" the times until you get 3 ticks on the screen. Maybe it's my accent but it took several attempts for me to get the ticks! Hope this helps.
This isn't an Xperia Z3 issue, it's a Google issue. I've had to also set the language to English (US) on my Xperia T.
Step 1: Move to America Step 2: Buy a truck too big for standard parking spaces but park there anyway. Step 3: Say "Ok google" ..and then it should work fine!
You joke, but I've found that the voice recognition of my third party keyboard works best if I talk in a thick, Texan American accent, like a cowboy! And what makes it even funnier is that the keyboard is TouchPal, which is made in China, not America.