Gorilla Glue is available from Bunnings and other hardware stores. Or Gorilla Grip construction adhesive.
Yes they expand and foam to make a good strong fillet. Tack the part tight in place first, then glue around if you are concerned about glue getting inside the assembly.
You can trim surplus foam with a knife and sand if required. Don't buy too much as can go off on the shelf, if air or moisture get into it.