Yes you can usually hug and touch an inmate when visiting them in the visiting area of the prison.
You however cannot usually engage in kissing and hugging too long as in sexual attraction with the inmate but a regular hug is usually okay.
Inmates are allowed by law 4 hours of visiting time each month which occurs for 1 hour at a time once per week and if you live further away from the prison sometimes you can get a few more hours of visit time but it must be approved by the prison beforehand.