This paper studies Positivstellensätze and moment problems for sets K that are given by universal quantifiers. Let Q be a closed set and let g=(g1,...,gs) be a tuple of polynomials in two vector variables x and y. Then K is described as the set of all points x such that each gj(x,y)≥0 for all y∈Q. Fix a finite nonnegative Borel measure ν with supp(ν)=Q, and assume it satisfies the multivariate Carleman condition. The first main result of the paper is a Positivstellensatz with universal quantifiers: if a polynomial f(x) is positive on K, then it belongs to the quadratic module QM(g,ν) associated to (g,ν), under the archimedeanness assumption on QM(g,ν). Here, QM(g,ν) denotes the quadratic module of polynomials in x that can be represented as \[\tau_0(x) + \int \tau_1(x,y)g_1(x, y)\, d\nu(y) + \cdots + \int \tau_s(x,y) g_s(x, y)\, d\nu(y), \] where each τj is a sum of squares polynomial. Second, necessary and sufficient conditions for a full (or truncated) multisequence to admit a representing measure supported in K are given. In particular, the classical flat extension theorem of Curto and Fialkow is generalized to truncated moment problems on such a set K. Finally, applications of these results for solving semi-infinite optimization problems are presented.