Let $N$ be a smooth manifold with boundary, and let $\omega \in \Omega^m(N)$.
Suppose that for every smooth $m$-dimensional manifold $M$ with boundary, and for every smooth maps $f_0,f_1:M \to N$ such that $f_0|_{\partial M}=f_1|_{\partial M}$, we have $\int_M f_0^* \omega=\int_M f_1^* \omega$.
Is it true $\omega$ is exact? Does anything change if we only assume $\int_M f_0^* \omega=\int_M f_1^* \omega$ for arbitrary maps $f$ from a fixed manifold $M$?
I am quite sure $\omega$ must be closed. The argument should be similar to the one given here.
Note that in dimension $1$, this is a classic result, and that the converse direction is immediate:
Let $f:M \to N$ be smooth. By assumption, $\omega=d\eta$ for some $\eta \in \Omega^{m-1}(N)$. Thus $$ \int_{M}f^*\omega=\int_{M}f^*d\eta=\int_{M}df^*\eta=\int_{\partial M}f^*\eta $$ depends only on $f|_{\partial M}$.
This is a bit long for a comment.
Suppose $N$ is closed and oriented and that we know that $\omega$ is closed. Then taking $M$ to be a closed manifold without boundary, $f_0$ an embedding and $f_1$ a constant map, it follows that $\int_Mf_0^*\omega=0$. So $\omega$ integrates to zero over every embedded submanifold.
But I think it then follows by Poincare duality that $[\omega]=0\in H^d(N)$, i.e. that $\omega$ is exact. You will need that every cohomology class is the poincare dual of (a real multiple of) an embedded submanifold.
I don't think you can infer much if you only take a fixed manifold $M$.