If we get answers for our doubts from this site can we acknowledge math stack exchange or for that matter the author who has responded to our doubts?
I see no reason why you can't acknowledge MSE for anything. Credit where credit is due!
The real question is should you acknowledge MSE. If the context is research that gained significant inspiration or other advantage from an MSE thread, then an acknowledgement is probably in order, and I believe the appropriate procedure in this case has been well discussed on meta. (See Gerry's links.)
If the context is homework, use your best judgement. Very commonly professors ask that you give credit where credit is due if you received outside assistance on a problem, and in this case you should consider acknowledging MSE.
If the context is proposing to your girlfriend, use your very best judgement.
Acknowledging a specific user is more tricky, and you may want to ask for permission from the user first.