Syntactically, it will work for scalar UDF, but not a stored procedure.
select myTable.id_customer, mySchema.myFunction(myTable.id_customer) As myAlias
from myTable
group by myTable.id_customer
However, depending on what the scalar UDF does, there may be more efficient approaches. If it is looking for a value in another table, for example, it is best to simply insert this logic into the query.