Yes you can. If your transducer has a built-in temp sensor it won't be accurate glued in the hull, but sonar will work fine.

Just make sure it is pointing straight down where it's mounted.